diff options
author | César Natarén <cesar@mono-cvs.ximian.com> | 2004-04-01 00:49:51 +0400 |
---|---|---|
committer | César Natarén <cesar@mono-cvs.ximian.com> | 2004-04-01 00:49:51 +0400 |
commit | 2aa554329048664f7378ad49d394f559bff9b670 (patch) | |
tree | 5963b2adf2425d7ac37e86bfe6a513b5c54216ae /mcs/class/Microsoft.JScript | |
parent | 6b06ae74fc0365fbbba4189f2e899a552736f987 (diff) |
updates from grammar changes
svn path=/trunk/mcs/; revision=24883
Diffstat (limited to 'mcs/class/Microsoft.JScript')
-rw-r--r-- | mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptParser.cs | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptParser.cs b/mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptParser.cs index 51e305238b5..ccb51c5095d 100644 --- a/mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptParser.cs +++ b/mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptParser.cs @@ -1,4 +1,4 @@ -// $ANTLR 2.7.3rc2: "jscript-lexer-parser.g" -> "JScriptParser.cs"$ +// $ANTLR 2.7.3rc3-20040317: "jscript-lexer-parser.g" -> "JScriptParser.cs"$ namespace Microsoft.JScript { @@ -305,7 +305,7 @@ _loop4_breakloop: ; case LITERAL_while: case LITERAL_for: { - iteration_stm(parent); + stm=iteration_stm(parent); break; } case LITERAL_continue: @@ -657,10 +657,16 @@ _loop15_breakloop: ; return if_stm; } - public void iteration_stm( + public AST iteration_stm( AST parent ) //throws RecognitionException, TokenStreamException { + AST iter; + + + iter = null; + AST stm = null; + AST exprn = null; switch ( LA(1) ) @@ -668,21 +674,33 @@ _loop15_breakloop: ; case LITERAL_do: { match(LITERAL_do); - statement(null); + stm=statement(parent); match(LITERAL_while); match(OPEN_PARENS); - expr(parent); + exprn=expr(parent); match(CLOSE_PARENS); match(SEMI_COLON); + if (0==inputState.guessing) + { + + iter = new DoWhile (parent, stm, exprn); + + } break; } case LITERAL_while: { match(LITERAL_while); match(OPEN_PARENS); - expr(parent); + exprn=expr(parent); match(CLOSE_PARENS); - statement(null); + stm=statement(parent); + if (0==inputState.guessing) + { + + iter = new While (parent, exprn, stm); + + } break; } case LITERAL_for: @@ -699,6 +717,7 @@ _loop15_breakloop: ; throw new NoViableAltException(LT(1), getFilename()); } } + return iter; } public AST continue_stm() //throws RecognitionException, TokenStreamException |