Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv27032/src/org/webmacro/parser Modified Files: WMParser_impl.java WMParser_impl.jj WMParser_implConstants.java WMParser_implTokenManager.java Log Message: - multi-line value support for maps and lists - multi-line support for anything that takes an argument list: $functions(), #macros(), and $Variable.methodCall() - multi-line support for #if statements Index: WMParser_impl.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** WMParser_impl.java 13 May 2003 05:29:17 -0000 1.47 --- WMParser_impl.java 14 May 2003 05:01:19 -0000 1.48 *************** *** 712,719 **** switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: ! jj_consume_token(WS); break; default: ! jj_la1[26] = jj_gen; ; } --- 712,743 ---- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { [...4192 lines suppressed...] } --- 4353,4357 ---- jj_ntk = -1; jj_gen = 0; ! for (int i = 0; i < 156; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } *************** *** 3155,3159 **** jj_kind = -1; } ! for (int i = 0; i < 104; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { --- 4468,4472 ---- jj_kind = -1; } ! for (int i = 0; i < 156; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { Index: WMParser_impl.jj =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.jj,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** WMParser_impl.jj 13 May 2003 05:29:18 -0000 1.45 --- WMParser_impl.jj 14 May 2003 05:01:20 -0000 1.46 *************** *** 284,288 **** | <LBRACKET: "["> | <RBRACKET: "]"> ! | <ASSOC: "=>"> | <DOT: "."> | <OP_LT: "<"> --- 284,288 ---- | <LBRACKET: "["> | <RBRACKET: "]"> ! | <COLON: ":"> | <DOT: "."> | <OP_LT: "<"> *************** *** 716,720 **** } { ! <LPAREN> [ <WS> ] e=Expression() [ <WS> ] <RPAREN> { return e; } } --- 716,720 ---- } { ! <LPAREN> [(<WS>|<NEWLINE>)+] e=Expression() [(<WS>|<NEWLINE>)+] <RPAREN> { return e; } } *************** *** 826,829 **** --- 826,831 ---- } + + MapBuilder MapArgList() : { MapBuilder map = new MapBuilder(); *************** *** 831,837 **** } { ! [ [<WS>] key=Expression() [<WS>] <ASSOC> [<WS>] value=Expression() [<WS>] { map.put(key, value); } ( ! <COMMA> [<WS>] key=Expression() [<WS>] <ASSOC> [<WS>] value=Expression() [<WS>] { map.put(key, value); } ) * ] --- 833,839 ---- } { ! [ [(<WS>|<NEWLINE>)+] key=Expression() [(<WS>|<NEWLINE>)+] <COLON> [(<WS>|<NEWLINE>)+] value=Expression() [(<WS>|<NEWLINE>)+] { map.put(key, value); } ( ! <COMMA> [(<WS>|<NEWLINE>)+] key=Expression() [(<WS>|<NEWLINE>)+] <COLON> [(<WS>|<NEWLINE>)+] value=Expression() [(<WS>|<NEWLINE>)+] { map.put(key, value); } ) * ] *************** *** 852,858 **** } { ! [ [<WS>] e=Expression() [<WS>] { list.addElement(e); } ( ! <COMMA> [ <WS> ] e=Expression() [<WS>] { list.addElement(e); } ) * ] --- 854,860 ---- } { ! [ [(<WS>|<NEWLINE>)+] e=Expression() [(<WS>|<NEWLINE>)+] { list.addElement(e); } ( ! <COMMA> [(<WS>|<NEWLINE>)+] e=Expression() [(<WS>|<NEWLINE>)+] { list.addElement(e); } ) * ] *************** *** 874,880 **** { [ <LPAREN> ! [ [<WS>] <DOLLAR> name=<WORD> [<WS>] { list.add(name.image); } ( ! <COMMA> [ <WS> ] <DOLLAR> name=<WORD> [<WS>] { list.add(name.image); } ) * ] --- 876,882 ---- { [ <LPAREN> ! [ [(<WS>|<NEWLINE>)+] <DOLLAR> name=<WORD> [(<WS>|<NEWLINE>)+] { list.add(name.image); } ( ! <COMMA> [(<WS>|<NEWLINE>)+] <DOLLAR> name=<WORD> [(<WS>|<NEWLINE>)+] { list.add(name.image); } ) * ] *************** *** 900,904 **** ( e=VariableReference() ! | <LPAREN> [<WS>] e=Expression() [<WS>] <RPAREN> | e=QuotedString() | e=BracketList() --- 902,906 ---- ( e=VariableReference() ! | <LPAREN> [(<WS>|<NEWLINE>)+] e=Expression() [(<WS>|<NEWLINE>)+] <RPAREN> | e=QuotedString() | e=BracketList() *************** *** 980,984 **** { e1=AExpression() ! [ LOOKAHEAD(2) [<WS>] op=RelOp() [<WS>] e2=AExpression() ] { if (op == null) --- 982,986 ---- { e1=AExpression() ! [ LOOKAHEAD(4) [(<WS>|<NEWLINE>)+] op=RelOp() [(<WS>|<NEWLINE>)+] e2=AExpression() ] { if (op == null) *************** *** 1004,1008 **** e=CExpression() ( ! LOOKAHEAD(2) [<WS>] <OP_AND> [<WS>] e2=CExpression() { e = new Expression.AndBuilder(e, e2); --- 1006,1010 ---- e=CExpression() ( ! LOOKAHEAD(4) [(<WS>|<NEWLINE>)+] <OP_AND> [(<WS>|<NEWLINE>)+] e2=CExpression() { e = new Expression.AndBuilder(e, e2); *************** *** 1018,1022 **** e=AndExpression() ( ! LOOKAHEAD(2) [<WS>] <OP_OR> [<WS>] e2=AndExpression() { e = new Expression.OrBuilder(e, e2); --- 1020,1024 ---- e=AndExpression() ( ! LOOKAHEAD(4) [(<WS>|<NEWLINE>)+] <OP_OR> [(<WS>|<NEWLINE>)+] e2=AndExpression() { e = new Expression.OrBuilder(e, e2); Index: WMParser_implConstants.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_implConstants.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** WMParser_implConstants.java 13 May 2003 05:29:18 -0000 1.11 --- WMParser_implConstants.java 14 May 2003 05:01:20 -0000 1.12 *************** *** 39,43 **** int LBRACKET = 34; int RBRACKET = 35; ! int ASSOC = 36; int DOT = 37; int OP_LT = 38; --- 39,43 ---- int LBRACKET = 34; int RBRACKET = 35; ! int COLON = 36; int DOT = 37; int OP_LT = 38; *************** *** 106,110 **** "\"[\"", "\"]\"", ! "\"=>\"", "\".\"", "\"<\"", --- 106,110 ---- "\"[\"", "\"]\"", ! "\":\"", "\".\"", "\"<\"", Index: WMParser_implTokenManager.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_implTokenManager.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** WMParser_implTokenManager.java 13 May 2003 05:29:18 -0000 1.25 --- WMParser_implTokenManager.java 14 May 2003 05:01:20 -0000 1.26 *************** *** 685,688 **** --- 685,690 ---- case 47: return jjStopAtPos(0, 48); + case 58: + return jjStopAtPos(0, 36); case 59: return jjStopAtPos(0, 53); *************** *** 692,696 **** case 61: jjmatchedKind = 43; ! return jjMoveStringLiteralDfa1_3(0x41000000000L); case 62: jjmatchedKind = 40; --- 694,698 ---- case 61: jjmatchedKind = 43; ! return jjMoveStringLiteralDfa1_3(0x40000000000L); case 62: jjmatchedKind = 40; *************** *** 733,740 **** return jjStopAtPos(1, 42); break; - case 62: - if ((active0 & 0x1000000000L) != 0L) - return jjStopAtPos(1, 36); - break; case 97: return jjMoveStringLiteralDfa2_3(active0, 0x10000000L); --- 735,738 ---- *************** *** 1364,1370 **** "\134", "\43", "\42", "\47", "\156\165\154\154", "\164\162\165\145", "\146\141\154\163\145", "\165\156\144\145\146\151\156\145\144", null, null, "\50", "\51", "\133", ! "\135", "\75\76", "\56", "\74", "\74\75", "\76", "\76\75", "\75\75", "\75", null, ! "\53", "\55", "\52", "\57", null, null, null, "\54", "\73", null, null, null, null, ! null, }; public static final String[] lexStateNames = { "SQS", --- 1362,1367 ---- "\134", "\43", "\42", "\47", "\156\165\154\154", "\164\162\165\145", "\146\141\154\163\145", "\165\156\144\145\146\151\156\145\144", null, null, "\50", "\51", "\133", ! "\135", "\72", "\56", "\74", "\74\75", "\76", "\76\75", "\75\75", "\75", null, "\53", ! "\55", "\52", "\57", null, null, null, "\54", "\73", null, null, null, null, null, }; public static final String[] lexStateNames = { "SQS", |