59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
token: keyword | identifier | constant | string-litteral | punctuator
|
|
|
|
keyword: "auto" | "break" | "case" | "char" | "const" | "continue"
|
|
| "default" | "do" | "double" | "else" | "enum" | "extern"
|
|
| "float" | "for" | "goto" | "if" | "inline" | "int" | "long"
|
|
| "register" | "restrict" | "return" | "short" | "signed"
|
|
| "sizeof" | "static" | "struct" | "switch" | "typedef"
|
|
| "union" | "unsigned" | "void" | "volatile" | "while"
|
|
| "_Bool" | "_Complex" | "_Imaginary"
|
|
|
|
punctuator: "[" | "]" | "(" | ")" | "{" | "}" | "." | "->" | "++" | "--"
|
|
| "&" | "*" | "+" | "-" | "~" | "!" | "/" | "%" | "<<" | ">>"
|
|
| "<" | ">" | "<=" | ">=" | "==" | "!=" | "^" | "|" | "&&"
|
|
| "||" | "?" | ":" | ";" | "..." | "=" | "*=" | "/=" | "%="
|
|
| "+=" | "-=" | "<<=" | ">>=" | "&=" | "^=" | "|=" | "," | "#"
|
|
| "##" | "<:" | ":>" | "<%" | "%>" | "%:" | "%:%:"
|
|
|
|
type-specifier: "void" | "char" | "short" | "int" | "long" | "float"
|
|
| "double" | "signed" | "unsigned" | "_Bool"
|
|
| "_Complex" | "_Imaginary" | struct-or-union-specifier
|
|
| enum-specifier | typedef-name
|
|
|
|
function-specifier: "inline"
|
|
|
|
function-specifier: "inline"
|
|
|
|
type-qualifier: "const" | "restrict" | "volatile"
|
|
|
|
pointer: "*" type-qualifier-list-opt { "*" type-qualifier-list-opt }
|
|
|
|
parameter-list: parameter-declaration { "," parameter-declaration }
|
|
|
|
parameter-declaration: declaration-specifiers ( declarator
|
|
| abstract-declarator-opt )
|
|
|
|
identifier-list: identifier { "," identifier }
|
|
|
|
compound-statement: { block-item-list-opt }
|
|
|
|
block-item-list: block-item { block-item }
|
|
|
|
block-item: declaration | statement
|
|
|
|
function-definition: declaration-specifiers declarator declaration-list-opt
|
|
compound-statement
|
|
|
|
declaration-list: declaration { declaration }
|
|
|
|
digit: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
|
|
|
|
lparen: "("
|
|
(rule 1)
|
|
|
|
new-line: "\n"
|
|
|
|
==
|
|
|
|
rule 1: - there must not be preceding white spaces
|