Chris Lattner
9b6d4cb90e
Add (basic) expression AST representation capabilities for int/fp/binops/condexpr.
...
Add callbacks for same.
Add "full locinfo" mode.
llvm-svn: 38939
2006-08-23 05:17:46 +00:00
Chris Lattner
38ba3363ef
Hook up more of the ASTStreamer
...
llvm-svn: 38936
2006-08-17 07:04:37 +00:00
Chris Lattner
3e7bd4ed44
Start adding support for printing out parser callbacks and adding ast building
...
llvm-svn: 38933
2006-08-17 05:51:27 +00:00
Chris Lattner
0116c478e6
Implement asm statement parsing.
...
llvm-svn: 38929
2006-08-15 06:03:28 +00:00
Chris Lattner
5646b3e21c
Fix test/Parser/types.c
...
llvm-svn: 38928
2006-08-15 05:12:01 +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
e37e2336b4
Parse attributes in all places allowed.
...
llvm-svn: 38925
2006-08-15 04:50:22 +00:00
Chris Lattner
b8cd5c2260
Parse (and ignore) attributes on global decls.
...
llvm-svn: 38924
2006-08-15 04:10:46 +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
8a3e918e33
Correctly implement the check for a typedef name
...
llvm-svn: 38921
2006-08-14 15:44:00 +00:00
Chris Lattner
0fb8b36808
"enum x" really is a type specifier
...
llvm-svn: 38920
2006-08-14 01:30:12 +00:00
Chris Lattner
ffe65b3ffd
Implement scope tracking for empty-action.
...
llvm-svn: 38919
2006-08-14 01:28:29 +00:00
Chris Lattner
3b4fdda3d8
Fix the last remaining FIXME's in the parser by asking the actions module
...
whether or not an identifier is a typedef name.
llvm-svn: 38915
2006-08-14 00:45:39 +00:00
Chris Lattner
a5534f96dc
Stub out the EmptyAction class.
...
llvm-svn: 38914
2006-08-14 00:38:06 +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
f0f3baa12e
Inform actions about parsed declarators.
...
llvm-svn: 38910
2006-08-14 00:15:20 +00:00
Chris Lattner
e4e38595b0
Add methods for scope manipulation.
...
llvm-svn: 38909
2006-08-14 00:15:05 +00:00
Chris Lattner
b8bbad7fd1
Set TypeSpecType on 'struct x' with no body.
...
llvm-svn: 38904
2006-08-13 22:21:02 +00:00
Chris Lattner
da72c82e8e
Recognize struct/union/enum as TypeSpecType's
...
llvm-svn: 38903
2006-08-13 22:16:42 +00:00
Chris Lattner
476c3adb69
implement the GNU case-range extension. Add todo's for other missing gnu extensions.
...
llvm-svn: 38902
2006-08-13 22:09:58 +00:00
Chris Lattner
e7dab44cab
improve comment.
...
llvm-svn: 38901
2006-08-13 21:54:51 +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
1890ac8b03
Parse struct/union specifiers.
...
llvm-svn: 38897
2006-08-13 01:16:23 +00:00
Chris Lattner
3b561a3b39
Implement parsing of enum-specifiers.
...
llvm-svn: 38896
2006-08-13 00:12:11 +00:00
Chris Lattner
0be454e182
Use ExpectAndConsume more
...
llvm-svn: 38895
2006-08-12 19:30:51 +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
1112435558
Parse the GNU builtin expressions. This implements Parser/expressions.c:test_offsetof
...
llvm-svn: 38893
2006-08-12 19:16:08 +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
9fab3b9486
Implement parsing of 'int A[X];' by tying into the expression parsing code.
...
Turn a bunch of fixme's into todo's.
llvm-svn: 38888
2006-08-12 18:25:42 +00:00
Chris Lattner
0c6c034c48
Two fixes:
...
1. Allow argument list of a call to be empty.
2. Handle expressions in a statement context that start with an identifier.
These are nasty to handle due to the 'label:' production which requires
having two tokens of look-ahead, or by having tricky code (which we
choose to do).
llvm-svn: 38887
2006-08-12 18:12:45 +00:00
Chris Lattner
20c6a45a3c
Split postfix-expression suffix handling out into ParsePostfixExpressionSuffix
...
for future use.
llvm-svn: 38885
2006-08-12 17:40:43 +00:00
Chris Lattner
ce7e21da7a
Implement ParseAssignmentExpression correctly
...
llvm-svn: 38884
2006-08-12 17:22:40 +00:00
Chris Lattner
3af6b8b9dc
remove bogus fixme
...
llvm-svn: 38883
2006-08-12 17:21:27 +00:00
Chris Lattner
89d53752f5
Fix parsing of assignment expressions and handling of right-associative
...
things.
llvm-svn: 38881
2006-08-12 17:18:19 +00:00
Chris Lattner
96c3deb53d
Simplify handling of the ternary operator even more. Now it just looks like
...
any average right-associative operator to most of the code.
llvm-svn: 38880
2006-08-12 17:13:08 +00:00
Chris Lattner
d35c34f44d
Fix incorrect parsing of the ?: middle term, which is supposed to be
...
parsed as 'expression'. This implements test/Parser/statements.c
llvm-svn: 38879
2006-08-12 17:04:50 +00:00
Chris Lattner
a0927cecb5
Improve diagnostics on cases like:
...
return a ? ` a;
After the expression is diagnosed, skip to the ';', so that the lack of
semicolon is not also diagnosed.
llvm-svn: 38877
2006-08-12 16:59:03 +00:00
Chris Lattner
6c3f05d1d2
Diagnose use of compound literals in C90 code
...
llvm-svn: 38876
2006-08-12 16:54:25 +00:00
Chris Lattner
b7f1fc95d3
cleanups, better comments.
...
llvm-svn: 38875
2006-08-12 16:45:01 +00:00
Chris Lattner
cde626ae9b
Implement a first cut at binary expression parsing using a simple operator
...
precedence-based parser.
llvm-svn: 38874
2006-08-12 08:13:25 +00:00
Chris Lattner
89c50c65af
Return information about whether expression parsing was successful
...
llvm-svn: 38873
2006-08-11 06:41:18 +00:00
Chris Lattner
5bd57e0c73
Significant improvements to error recovery
...
llvm-svn: 38872
2006-08-11 06:40:25 +00:00
Chris Lattner
81b576ee0d
Merge ParsePostfixExpression into ParseCastExpression. This allows us to
...
implement support for compound literals followed by postfix-expr suffixes,
such as:
(struct{ int a;}){ 1}.a
llvm-svn: 38871
2006-08-11 02:13:20 +00:00
Chris Lattner
eaf06598ea
Merge ParseUnaryExpression and ParseCastExpression.
...
llvm-svn: 38869
2006-08-11 02:02:23 +00:00
Chris Lattner
a092cd1f1b
Implement parsing of casts, implementing Parser/statements.c:test6
...
llvm-svn: 38868
2006-08-11 01:38:28 +00:00
Chris Lattner
4add4e6c12
Simplify paren parsing, finish parsing of sizeof expressions and other cases.
...
llvm-svn: 38866
2006-08-11 01:33:00 +00:00
Chris Lattner
f5fbd7963d
Implement type-name parsing, and simple compound initializer parsing.
...
llvm-svn: 38865
2006-08-10 23:56:11 +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
c2dd85ac9e
Implement most of unary-expression parsing.
...
llvm-svn: 38862
2006-08-10 22:57:16 +00:00
Chris Lattner
f833977a8a
implement postfix-expression parsing.
...
llvm-svn: 38861
2006-08-10 22:01:51 +00:00
Chris Lattner
52a99e5cee
Parse primary expressions, handle string concatenation
...
llvm-svn: 38860
2006-08-10 20:56:00 +00:00
Chris Lattner
c5e0d4a6ae
stub out some entry points for the expr parsing code.
...
llvm-svn: 38858
2006-08-10 19:06:03 +00:00
Chris Lattner
eb8a28f7b7
Rename some files
...
llvm-svn: 38855
2006-08-10 18:43:39 +00:00
Chris Lattner
2f9980ef14
Implement Parser/statements.c:test5: parsing decls that start with identifiers
...
in blocks.
llvm-svn: 38854
2006-08-10 18:39:24 +00:00
Chris Lattner
6dfd97806e
Add support for simple labels.
...
llvm-svn: 38853
2006-08-10 18:31:37 +00:00
Chris Lattner
f8afb62ef9
Add support for parsing declarations in blocks. This implements
...
Parser/statements.c:test4
llvm-svn: 38852
2006-08-10 18:26:31 +00:00
Chris Lattner
d2685cf6bb
Parse case/default labeled-statements.
...
llvm-svn: 38851
2006-08-10 05:59:48 +00:00
Chris Lattner
503fadc90f
Parse jump-statement: goto, continue, break, return.
...
llvm-svn: 38849
2006-08-10 05:45:44 +00:00
Chris Lattner
ab180365ac
Add a warning
...
llvm-svn: 38848
2006-08-10 05:22:36 +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
9075bd7727
implement switch/while/do/for statement parsing, implementing Parser/statements.c:test2
...
llvm-svn: 38846
2006-08-10 04:59:57 +00:00
Chris Lattner
c951dae2a4
Parse if statements
...
llvm-svn: 38844
2006-08-10 04:23: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
d5d0a6c2b5
Capture function information, provide a place to validate Declarator information.
...
llvm-svn: 38838
2006-08-07 00:58:14 +00:00
Chris Lattner
a350722189
comment cleanup
...
llvm-svn: 38837
2006-08-07 00:33:37 +00:00
Chris Lattner
6c7416c382
Start capturing pointer and array declarator info.
...
llvm-svn: 38836
2006-08-07 00:19:33 +00:00
Chris Lattner
14776b9501
Implement some more error recovery
...
llvm-svn: 38835
2006-08-06 22:27:40 +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
1906f8087d
Improve handling of [*]
...
llvm-svn: 38831
2006-08-06 19:14:46 +00:00
Chris Lattner
8a39edc931
Warn for c99-specific array use
...
llvm-svn: 38830
2006-08-06 18:33:32 +00:00
Chris Lattner
e8074e65dd
Parse array declarators, tested by Parser/declarators.c
...
llvm-svn: 38828
2006-08-06 18:30:15 +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
8e90ef6ccc
add some notes
...
llvm-svn: 38817
2006-08-05 03:30:45 +00:00
Chris Lattner
f63f89acc2
Handle __thread and storage-class-specifiers
...
llvm-svn: 38816
2006-08-05 03:28:50 +00:00
Chris Lattner
158ede8e44
Add a citation
...
llvm-svn: 38814
2006-08-04 06:42:38 +00:00
Chris Lattner
1ae23294fb
C99 requires at least one type specifier.
...
llvm-svn: 38813
2006-08-04 06:42:31 +00:00
Chris Lattner
fef9d2bba7
Diagnose specifiers with invalid _Complex/_Imaginary components.
...
llvm-svn: 38812
2006-08-04 06:36:52 +00:00
Chris Lattner
839713c085
Emit diagnostics for things like 'signed _Bool' and 'short float'
...
llvm-svn: 38811
2006-08-04 06:15:52 +00:00
Chris Lattner
deb42f5a96
Add some missing assignments.
...
llvm-svn: 38808
2006-08-04 05:26:52 +00:00
Chris Lattner
da48a8e66b
Parse and validate cvr type-qualifiers
...
llvm-svn: 38807
2006-08-04 05:25:55 +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