diff --git a/config.sh b/config.sh new file mode 100644 index 0000000..e56721c --- /dev/null +++ b/config.sh @@ -0,0 +1,5 @@ +PACKAGE="c99" +VERSION="0.0.0" + +PREFIX="/usr/local" +LIBDIR="${PREFIX}/lib" diff --git a/doc/GRAMMAR b/doc/GRAMMAR new file mode 100644 index 0000000..456be52 --- /dev/null +++ b/doc/GRAMMAR @@ -0,0 +1,58 @@ +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