# SYMBOL
foo = $some_symbol
+# MAP
+foo = {
+ $foo : 1 + 1,
+ $bar : 2 + 2,
+ $stuff : 3 + 3
+}
+
#% if [
# (Ex Bk) : exec_if($1, $2),
# (Ex Bk Bk) : exec_if($1, $2, $3)
return node;
}
+// MapLiteral = '{' (Literal ':' LogicalExpr)* '}'
AST* DLParser::MapLiteral(void)
{
AST* ret = NULL;
- throw Exception(lookaheadToken(1).line(), lookaheadToken(1).column());
+
+ //throw Exception(lookaheadToken(1).line(),lookaheadToken(1).column());
+ match(LBRACE);
+ do
+ {
+ if( lookaheadType(1) == COMMA ) consume();
+
+ AST* child = Literal();
+ match(SEP);
+ child = _new AST(SEP, 2, child, LogicalExpr());
+
+ ret = ((ret == NULL) ? _new AST(MAP) : ret);
+ ret->addChild(child);
+ }
+ while( lookaheadType(1) == COMMA );
+ match(RBRACE);
+
return ret;
}
{
string input_fname(argv[1]);
string temp_fname = createTempFileName( input_fname );
- (void)temp_fname;
DLParser parser;
ASTPrinter* visitor = NULL;