From f255f2498da1fd985ad1ed79362580bbf4675723 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Sun, 18 Sep 2016 21:39:45 +0000 Subject: rm test-chill, create doc subdir --- test-chill/testchill/cpp_validate/grammar.txt | 124 -------------------------- 1 file changed, 124 deletions(-) delete mode 100644 test-chill/testchill/cpp_validate/grammar.txt (limited to 'test-chill/testchill/cpp_validate/grammar.txt') diff --git a/test-chill/testchill/cpp_validate/grammar.txt b/test-chill/testchill/cpp_validate/grammar.txt deleted file mode 100644 index fdb8c00..0000000 --- a/test-chill/testchill/cpp_validate/grammar.txt +++ /dev/null @@ -1,124 +0,0 @@ -terminals: - Identifier '[a-zA-Z_][a-zA-Z_0-9]*' - NumericLiteral '[0-9]+(\.[0-9]+)?' - Comment '\#([^\x0a])*' - WS '\s+' -ignore: WS, , Comment -rules: - ::= - :w => w - :p => p - ::= - 'with' '{' :decls '}' :p => addbindings(p, dict(decls)) - ::= - eps => [] - :l => l - ::= - :l ',' :decl => l + [decl] - :decl => [decl] - ::= - Identifier:name ':' :e => (name, (None, e)) - :ctype Identifier:name ':' :e => (name, (ctype, e)) - - ::= - 'procedure' :rtype Identifier:name '(' :plist ')' - => Procedure(name, rtype, plist) - ::= - :bt '*' => CppPointerType(bt) - :bt :dims => CppArrayType(bt, dims) - 'void' => CppVoidType() - 'char' => CppPrimitiveType.get_from_cppname('char') - 'signed' 'char' => CppPrimitiveType.get_from_cppname('signed char') - 'unsigned' 'char' => CppPrimitiveType.get_from_cppname('unsigned char') - 'short' => CppPrimitiveType.get_from_cppname('short') - 'unsigned' 'short' => CppPrimitiveType.get_from_cppname('unsigned short') - 'int' => CppPrimitiveType.get_from_cppname('int') - 'unsigned' 'int' => CppPrimitiveType.get_from_cppname('unsigned int') - 'long' => CppPrimitiveType.get_from_cppname('long') - 'unsigned' 'long' => CppPrimitiveType.get_from_cppname('unsigned long') - 'long' 'long' => CppPrimitiveType.get_from_cppname('long long') - 'unsigned' 'long' 'long' => CppPrimitiveType.get_from_cppname('unsigned long long') - 'float' => CppPrimitiveType.get_from_cppname('float') - 'double' => CppPrimitiveType.get_from_cppname('double') - ::= - :dlist '[' :e ']' => dlist + [e] - :dlist '[' ']' => dlist + [None] - '[' ']' => [None] - '[' :e ']' => [e] - ::= - eps => [] - :l => l - ::= - :l ',' :p => l + [p] - :p => [p] - ::= - :d :t Identifier:name '=' :e => Parameter(name, t, d, e) - :d :t Identifier:name => Parameter(name, t, d, None) - ::= - 'in' => 'in' - 'out' => 'out' - 'in' 'out' => 'inout' - 'out' 'in' => 'inout' - eps => 'inout' - - - ::= - :e => e - 'lambda' :params ':' :e => LambdaExpr(params, e) - 'matrix' '(' :d ',' :e ')' => MatrixGenerator(d, e) - 'matrix' :dims :e => MatrixGenerator([d[1] for d in dims], LambdaExpr([d[0] for d in dims], e)) - ::= - :l '+' :r => BinExpr(l, '+', r) - :l '-' :r => BinExpr(l, '-', r) - :e => e - ::= - :l '*' :r => BinExpr(l, '*', r) - :l '/' :r => BinExpr(l, '/', r) - :e => e - ::= - '-' :e => UnaryExpr('-', e) - :e => e - ::= - :e => e - ::= - :l '**' :r => BinExpr(l, '**', r) - :e => e - ::= - '(' :e ')' => e - '[' :l ']' => l - Identifier:name => NameExpr(name) - NumericLiteral:num => ConstantExpr(num) - 'random' '(' :mn ',' :mx ')' => RandomExpr(mn, mx) - :f '(' :l ')' => InvokeExpr(f, l) - :n '.' Identifier:attr => AttributeExpr(n, attr) - ::= - eps => [] - :l => l - ::= - :l ',' :e => l + [e] - :e => [e] - ::= - '[' :l ']' => l - ::= - :l ',' :e => l + [e] - :e => [e] - ::= - eps => None - '*' => None - :e => e - ::= - eps => [] - :l => l - ::= - :l ',' Identifier:ident => l + [ident] - Identifier:ident => [ident] - ::= - '[' :l ']' => l - ::= - :l ',' :e => l + [e] - :e => [e] - ::= - Identifier:name => (name, None) - Identifier:name ':' :e => (name, e) - - -- cgit v1.2.3-70-g09d2