From 99c062c028c7f4e94fb38cde50772cfd3ea5ad3b Mon Sep 17 00:00:00 2001 From: Derick Huth Date: Thu, 24 Sep 2015 11:34:04 -0600 Subject: v0.2.1 --- test-chill/testchill/cpp_validate/grammar.txt | 124 --------------------- test-chill/testchill/cpp_validate/src/validate.cpp | 29 ----- 2 files changed, 153 deletions(-) delete mode 100644 test-chill/testchill/cpp_validate/grammar.txt delete mode 100644 test-chill/testchill/cpp_validate/src/validate.cpp (limited to 'test-chill/testchill/cpp_validate') 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) - - diff --git a/test-chill/testchill/cpp_validate/src/validate.cpp b/test-chill/testchill/cpp_validate/src/validate.cpp deleted file mode 100644 index f09009d..0000000 --- a/test-chill/testchill/cpp_validate/src/validate.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -//# defines -//# test-proc - -int main(int argc, char** argv) { - //# declarations - timespec start_time; - timespec end_time; - - std::ifstream datafile_initialize(argv[1]); - //# read-in - //# read-out - datafile_initialize.close(); - - clock_gettime(CLOCK_REALTIME, &start_time); - //# run - clock_gettime(CLOCK_REALTIME, &end_time); - - std::ofstream datafile_out(argv[2]); - //# write-out - datafile_out.close(); - - double time_diff = (end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec)/1000000000.0; - std::printf("(%f,)", time_diff); - return 0; -} -- cgit v1.2.3-70-g09d2