Commit Graph

90 Commits

Author SHA1 Message Date
Chris Lattner da59c2f161 Move objc productions to their own .cpp file.
llvm-svn: 39124
2006-11-05 02:08:13 +00:00
Chris Lattner 40f16b5d26 improve objc comments
llvm-svn: 39123
2006-11-05 02:05:37 +00:00
Chris Lattner 71e23ce2e1 Add AST node, AST building, actions, and printing for 'for' stmts.
llvm-svn: 39113
2006-11-04 20:18:38 +00:00
Chris Lattner 70058dda70 Emit:
test.m:2:14: error: expected ';' after @class
@ class foo  int x;
             ^

instead of silently accepting the malformed input.

llvm-svn: 39100
2006-11-03 07:32:21 +00:00
Chris Lattner aacc5af2c0 Fix case stmts to not fall through, rename methods, assert on unimplemented
pieces, emit a diagnostic like this:

test.m:4:1: error: unexpected '@' in program
@ foo;
^

llvm-svn: 39099
2006-11-03 07:21:07 +00:00
Steve Naroff b419d3a80e - Added basic structure for parsing top level Objective-C forms.
- Extended the typedef mechanism for classes, improved performance of the common case.
- Implemented @class in the parser.

llvm-svn: 39074
2006-10-27 23:18:49 +00:00
Chris Lattner 04132371bb Make ConsumeFoo methods return the location of the consumed token.
llvm-svn: 38995
2006-10-16 06:12:55 +00:00
Chris Lattner 30f910e88e implement action callbacks for almost all the stmts.
llvm-svn: 38993
2006-10-16 05:52:41 +00:00
Chris Lattner 2dacc3ff2e Changes through out the parser and actions/ast interface to return top-level
declarations through the asm streamer.  For a testcase like:

int G;
int H, I, *J;
int func() {}

'clang -parse-print-ast' prints:

Read top-level decl: G
Read top-level decl: H
Read top-level decl: I
Read top-level decl: J
Read top-level decl: func

llvm-svn: 38992
2006-10-16 00:33:54 +00:00
Chris Lattner a11999d83a start creating proper ast nodes for variables and functions
llvm-svn: 38991
2006-10-15 22:34:45 +00:00
Chris Lattner 8c2048710d Rename LexerToken methods to be more consistent.
llvm-svn: 38969
2006-10-14 05:19:21 +00:00
Chris Lattner d3e9895b9a Initial support for semantic analysis and AST building for StringExpr nodes.
llvm-svn: 38960
2006-10-06 05:22:26 +00:00
Chris Lattner 38ba3363ef Hook up more of the ASTStreamer
llvm-svn: 38936
2006-08-17 07:04:37 +00:00
Chris Lattner 0116c478e6 Implement asm statement parsing.
llvm-svn: 38929
2006-08-15 06:03:28 +00:00
Chris Lattner 04f8019616 Make MatchRHSPunctuation smarter, allowing its clients to be simpler.
llvm-svn: 38926
2006-08-15 04:55:54 +00:00
Chris Lattner 15a00da679 Allow ExpectAndConsume to be used with any token.
llvm-svn: 38923
2006-08-15 04:10:31 +00:00
Chris Lattner 6d7e634399 Parse asm specifiers on init declarators. Add __builtin_va_list to the
symbol table at startup time.

llvm-svn: 38922
2006-08-15 03:41:14 +00:00
Chris Lattner 685ed1e9ee Rename Parse/ParserActions.h -> Parse/Action.h
llvm-svn: 38913
2006-08-14 00:22:04 +00:00
Chris Lattner e4e38595b0 Add methods for scope manipulation.
llvm-svn: 38909
2006-08-14 00:15:05 +00:00
Chris Lattner 8693a519d4 Implement initializer parsering.
llvm-svn: 38900
2006-08-13 21:54:02 +00:00
Chris Lattner 0e89462b08 Parse things like 'struct X;'
llvm-svn: 38898
2006-08-13 19:58:17 +00:00
Chris Lattner dbb2a46915 Add a new ExpectAndConsume method to make parsing easier, and add a new
ConsumeAnyToken method.

llvm-svn: 38894
2006-08-12 19:26:13 +00:00
Chris Lattner 6259172911 Implement parsing of array declarators like:
int Array[*(int*)P+A];

llvm-svn: 38890
2006-08-12 18:40:58 +00:00
Chris Lattner 5bd57e0c73 Significant improvements to error recovery
llvm-svn: 38872
2006-08-11 06:40:25 +00:00
Chris Lattner 4564bc1123 Factor some code into the new Parser::MatchRHSPunctuation method.
llvm-svn: 38864
2006-08-10 23:14:52 +00:00
Chris Lattner eb8a28f7b7 Rename some files
llvm-svn: 38855
2006-08-10 18:43:39 +00:00
Chris Lattner 53361ac130 Refactor init-declarator-list parsing code to allow for-statements to have
initializers in them.

llvm-svn: 38847
2006-08-10 05:19:57 +00:00
Chris Lattner 0ccd51ebe2 Start parsing statements and function bodies. This implements
Parser/statements.c:test1.

llvm-svn: 38842
2006-08-09 05:47:47 +00:00
Chris Lattner fff824fe14 Simplify and fill out parsing of function bodies.
llvm-svn: 38841
2006-08-07 06:31:38 +00:00
Chris Lattner bf320c84a5 better comments, infrastructure for parsing function bodies.
llvm-svn: 38839
2006-08-07 05:05:30 +00:00
Chris Lattner eec40f9990 Start implementing error recovery, this implements test/Parser/recovery-1.c
llvm-svn: 38833
2006-08-06 21:55:29 +00:00
Chris Lattner acd58a3c33 Parse parenthesized and function declarators now, allowing us to parse things
like: "void (*signal(int, void (*)(int)))(int);"

llvm-svn: 38824
2006-08-06 17:24:14 +00:00
Chris Lattner 15356a7065 Start capturing declarator information in a new Declarator object.
llvm-svn: 38823
2006-08-06 00:02:28 +00:00
Chris Lattner 971c6b681a Add scaffolding for scopes.
llvm-svn: 38821
2006-08-05 22:46:42 +00:00
Chris Lattner d286488c5f Make error recovery "better"
llvm-svn: 38819
2006-08-05 08:09:44 +00:00
Chris Lattner d9c3c59fc0 Continue work on declspecs and declarations
llvm-svn: 38818
2006-08-05 06:26:47 +00:00
Chris Lattner b9093cd1d0 Add an initial cut at a datastructure for holding declspec's.
llvm-svn: 38805
2006-08-04 04:39:53 +00:00
Chris Lattner c0acd3d621 Split declaration parsing out into Declarations.cpp
llvm-svn: 38804
2006-07-31 05:13:43 +00:00
Chris Lattner 70f32b7d68 Add initial very-incomplete support for parsing declarations. We just manage
to be able to parse "int x;" now.

llvm-svn: 38803
2006-07-31 05:09:04 +00:00
Chris Lattner 0bb5f835e4 initial support for parsing, right now just ;'s at the top level, but this
adds most simple scaffolding.

llvm-svn: 38802
2006-07-31 01:59:18 +00:00