44 lines
957 B
Text
44 lines
957 B
Text
==========================================
|
|
simple declarations
|
|
==========================================
|
|
|
|
int x;
|
|
|
|
---
|
|
|
|
(program
|
|
(declaration (type_name (identifier)) (declarator (identifier))))
|
|
|
|
==========================================
|
|
simple functions
|
|
==========================================
|
|
|
|
int main() {
|
|
}
|
|
|
|
---
|
|
|
|
(program (function_definition
|
|
(type_name (identifier))
|
|
(declarator (identifier))
|
|
(compound_statement)))
|
|
|
|
==========================================
|
|
ambiguous declarations
|
|
==========================================
|
|
|
|
int main() {
|
|
int i;
|
|
someTypeOrValue * pointerOrMultiplicand();
|
|
float y;
|
|
}
|
|
|
|
---
|
|
|
|
(program (function_definition
|
|
(type_name (identifier))
|
|
(declarator (identifier))
|
|
(compound_statement
|
|
(declaration (type_name (identifier)) (declarator (identifier)))
|
|
(declaration (type_name (identifier)) (declarator (pointer) (identifier)))
|
|
(declaration (type_name (identifier)) (declarator (identifier))))))
|