Author: bernhard Date: Sat May 17 07:33:01 2008 New Revision: 27585 Modified: trunk/languages/plumhead/src/antlr3/GenPastNqp.g trunk/languages/plumhead/src/antlr3/GenPastNqp.java trunk/languages/plumhead/src/antlr3/PlumheadLexer.java trunk/languages/plumhead/src/antlr3/PlumheadParser.java
Log: [Plumhead antlr] Add nodes for IF back in. Fix NOQUOTESTRING. Modified: trunk/languages/plumhead/src/antlr3/GenPastNqp.g ============================================================================== --- trunk/languages/plumhead/src/antlr3/GenPastNqp.g (original) +++ trunk/languages/plumhead/src/antlr3/GenPastNqp.g Sat May 17 07:33:01 2008 @@ -70,11 +70,11 @@ String noquote = $NOQUOTE_STRING.text; noquote = noquote.replace( "\n", "\\n" ); System.out.println( - " # NOQUOTE_STRING \n" - + " PAST::Val.new( \n" - + " :returns( 'String' ), \n" - + " :value(" + noquote + ") \n" - + " ), \n" + " # NOQUOTE_STRING \n" + + " PAST::Val.new(\n" + + " :returns( 'String' ),\n" + + " :value(\"" + noquote + "\")\n" + + " ),\n" ); } | SINGLEQUOTE_STRING @@ -172,14 +172,15 @@ name = "infix:" + name; } | { - System.out.print( - " \n" + System.out.println( + " PAST::Op.new(\n" + + " :pasttype( 'if' ),\n" ); } ^( IF node node node? ) { System.out.print( - " \n" + " ), \n" ); } | { Modified: trunk/languages/plumhead/src/antlr3/GenPastNqp.java ============================================================================== --- trunk/languages/plumhead/src/antlr3/GenPastNqp.java (original) +++ trunk/languages/plumhead/src/antlr3/GenPastNqp.java Sat May 17 07:33:01 2008 @@ -1,4 +1,4 @@ -// $ANTLR 3.0.1 src/antlr3/GenPastNqp.g 2008-05-17 16:11:21 +// $ANTLR 3.0.1 src/antlr3/GenPastNqp.g 2008-05-17 16:30:01 import java.util.regex.*; @@ -292,11 +292,11 @@ String noquote = NOQUOTE_STRING1.getText(); noquote = noquote.replace( "\n", "\\n" ); System.out.println( - " # NOQUOTE_STRING \n" - + " PAST::Val.new( \n" - + " :returns( 'String' ), \n" - + " :value(" + noquote + ") \n" - + " ), \n" + " # NOQUOTE_STRING \n" + + " PAST::Val.new(\n" + + " :returns( 'String' ),\n" + + " :value(\"" + noquote + "\")\n" + + " ),\n" ); @@ -492,8 +492,9 @@ // src/antlr3/GenPastNqp.g:174:5: ^( IF node node ( node )? ) { - System.out.print( - " \n" + System.out.println( + " PAST::Op.new(\n" + + " :pasttype( 'if' ),\n" ); match(input,IF,FOLLOW_IF_in_node311); @@ -507,7 +508,7 @@ node(); _fsp--; - // src/antlr3/GenPastNqp.g:179:21: ( node )? + // src/antlr3/GenPastNqp.g:180:21: ( node )? int alt2=2; int LA2_0 = input.LA(1); @@ -516,7 +517,7 @@ } switch (alt2) { case 1 : - // src/antlr3/GenPastNqp.g:179:21: node + // src/antlr3/GenPastNqp.g:180:21: node { pushFollow(FOLLOW_node_in_node317); node(); @@ -532,14 +533,14 @@ match(input, Token.UP, null); System.out.print( - " \n" + " ), \n" ); } break; case 12 : - // src/antlr3/GenPastNqp.g:185:5: ^( STMTS ( node )* ) + // src/antlr3/GenPastNqp.g:186:5: ^( STMTS ( node )* ) { System.out.print( @@ -551,7 +552,7 @@ if ( input.LA(1)==Token.DOWN ) { match(input, Token.DOWN, null); - // src/antlr3/GenPastNqp.g:191:14: ( node )* + // src/antlr3/GenPastNqp.g:192:14: ( node )* loop3: do { int alt3=2; @@ -564,7 +565,7 @@ switch (alt3) { case 1 : - // src/antlr3/GenPastNqp.g:191:14: node + // src/antlr3/GenPastNqp.g:192:14: node { pushFollow(FOLLOW_node_in_node342); node(); @@ -591,7 +592,7 @@ } break; case 13 : - // src/antlr3/GenPastNqp.g:197:5: ^( ASSIGN_OP node node ) + // src/antlr3/GenPastNqp.g:198:5: ^( ASSIGN_OP node node ) { System.out.print( @@ -620,7 +621,7 @@ } break; case 14 : - // src/antlr3/GenPastNqp.g:208:5: SCALAR + // src/antlr3/GenPastNqp.g:209:5: SCALAR { match(input,SCALAR,FOLLOW_SCALAR_in_node383); @@ -632,7 +633,7 @@ } break; case 15 : - // src/antlr3/GenPastNqp.g:214:5: ^( ARRAY node ) + // src/antlr3/GenPastNqp.g:215:5: ^( ARRAY node ) { System.out.print( Modified: trunk/languages/plumhead/src/antlr3/PlumheadLexer.java ============================================================================== --- trunk/languages/plumhead/src/antlr3/PlumheadLexer.java (original) +++ trunk/languages/plumhead/src/antlr3/PlumheadLexer.java Sat May 17 07:33:01 2008 @@ -1,4 +1,4 @@ -// $ANTLR 3.0.1 src/antlr3/Plumhead.g 2008-05-17 16:11:18 +// $ANTLR 3.0.1 src/antlr3/Plumhead.g 2008-05-17 16:29:58 import org.antlr.runtime.*; import java.util.Stack; Modified: trunk/languages/plumhead/src/antlr3/PlumheadParser.java ============================================================================== --- trunk/languages/plumhead/src/antlr3/PlumheadParser.java (original) +++ trunk/languages/plumhead/src/antlr3/PlumheadParser.java Sat May 17 07:33:01 2008 @@ -1,4 +1,4 @@ -// $ANTLR 3.0.1 src/antlr3/Plumhead.g 2008-05-17 16:11:18 +// $ANTLR 3.0.1 src/antlr3/Plumhead.g 2008-05-17 16:29:58 import org.antlr.runtime.*; import java.util.Stack; @@ -878,7 +878,7 @@ // AST REWRITE - // elements: s2, IF, s1, relational_expression + // elements: relational_expression, IF, s1, s2 // token labels: // rule labels: retval, s2, s1 // token list labels: @@ -930,7 +930,7 @@ { // AST REWRITE - // elements: IF, s1, relational_expression + // elements: relational_expression, s1, IF // token labels: // rule labels: retval, s1 // token list labels: @@ -1039,7 +1039,7 @@ // AST REWRITE - // elements: val, ASSIGN_OP + // elements: ASSIGN_OP, val // token labels: // rule labels: val, retval // token list labels: @@ -1103,7 +1103,7 @@ // AST REWRITE - // elements: val, ASSIGN_OP, key + // elements: key, val, ASSIGN_OP // token labels: // rule labels: val, retval, key // token list labels: