Author: olivier
Date: 2007-05-26 20:14:33 -0400 (Sat, 26 May 2007)
New Revision: 77995
Modified:
trunk/olive/class/Mono.JScript.Compiler/ChangeLog
trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler.suo
trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler/Parser.cs
Log:
2007-05-27 Olivier Dufour <[EMAIL PROTECTED]>
* Go ahead in parser
Modified: trunk/olive/class/Mono.JScript.Compiler/ChangeLog
===================================================================
--- trunk/olive/class/Mono.JScript.Compiler/ChangeLog 2007-05-26 23:06:04 UTC
(rev 77994)
+++ trunk/olive/class/Mono.JScript.Compiler/ChangeLog 2007-05-27 00:14:33 UTC
(rev 77995)
@@ -1,5 +1,9 @@
2007-05-27 Olivier Dufour <[EMAIL PROTECTED]>
+ * Go ahead in parser
+
+2007-05-27 Olivier Dufour <[EMAIL PROTECTED]>
+
* Add a lof of stubs :BlockStatement, Expression, Statement, BadToken,
Compiler, DList, Identifier, JavaScriptCompiler, NumericLiteralToken, Parser,
StringLiteralToken
* Start to done the manual parser
Modified:
trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler/Parser.cs
===================================================================
--- trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler/Parser.cs
2007-05-26 23:06:04 UTC (rev 77994)
+++ trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler/Parser.cs
2007-05-27 00:14:33 UTC (rev 77995)
@@ -85,33 +85,239 @@
public Statement ParseStatement (ref List<Comment> Comments)
{
return ParseStatement ();
+ Comments = lexer.Comments;
}
private Statement ParseStatement ()
{
+ switch (current.Kind) {
+ case Token.Type.LeftBrace:
+ ParseBlock ();
+ break;
+ case Token.Type.Var:
+ ParseVarDeclaration ();
+ break;
+ case Token.Type.If:
+ ParseIfElse ();
+ break;
+ case Token.Type.While:
+ ParseWhile ();
+ break;
+ case Token.Type.Do:
+ ParseDo ();
+ break;
+ case Token.Type.For:
+ ParseFor ();
+ break;
+ case Token.Type.Continue:
+ ParseContinue ();
+ break;
+ case Token.Type.With:
+ ParseWith ();
+ break;
+ case Token.Type.Switch:
+ ParseSwitch ();
+ break;
+ case Token.Type.Throw:
+ ParseThrow ();
+ break;
+ case Token.Type.Try:
+ ParseTry ();
+ break;
+ case Token.Type.Break:
+ ParseBreak ();
+ break;
+ case Token.Type.Return:
+ ParseReturn ();
+ break;
+ case Token.Type.Function:
+ ParseFunctionDeclaration ();
+ break;
+ case Token.Type.Identifier:
+ Token ident = current;
+ Next ();
+ ParseExpression ();
+ break;
+ }
//TODO
/*
- block { $$ = $1; }
- | decl_var { $$ = $1; }
- | setvar { $$ = $1; }
- | if_else { $$ = $1; }
- | while { $$ = $1; }
- | do { $$ = $1; }
- | for { $$ = $1; }
- | continue { $$ = $1; }
- | with { $$ = $1; }
- | switch { $$ = $1; }
- | throw { $$ = $1; }
- | try { $$ = $1; }
| proc_call { $$ = $1; }
- | return { $$ = $1; }
- | function_decl
| inner_call
| increment_or_decremente
*/
throw new Exception ("The method or operation is not
implemented.");
}
+ private void ParseVarDeclaration ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseIfElse ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseWhile ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseDo ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseFor ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseContinue ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseWith ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseSwitch ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseThrow ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseTry ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseReturn ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseBreak ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseExpression ()
+ {
+ switch (current.Kind) {
+ case Token.Type.Equal:
+ ParseSetVar ();
+ break;
+ case Token.Type.LeftParenthesis:
+ ParseFunctionCall ();
+ break;
+ case Token.Type.PlusPlus:
+ ParsePlusPlus ();
+ break;
+ case Token.Type.MinusMinus:
+ ParseMinusMinus ();
+ break;
+ case Token.Type.Plus:
+ ParsePlus ();
+ break;
+ case Token.Type.Star:
+ ParseStar ();
+ break;
+ case Token.Type.Minus:
+ ParseMinus ();
+ break;
+ case Token.Type.Divide:
+ ParseDivide ();
+ break;
+ case Token.Type.Percent:
+ ParsePercent ();
+ break;
+ case Token.Type.LessLess:
+ ParseLessLess ();
+ break;
+ case Token.Type.GreaterGreater:
+ ParseGreaterGreater ();
+ break;
+ case Token.Type.Dot:
+ ParseMemberCall ();
+ break;
+ case Token.Type.New:
+ ParseNew ();
+ break;
+ }
+ }
+
+ private void ParseGreaterGreater ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseStar ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseNew ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseMemberCall ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseLessLess ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParsePercent ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseDivide ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseMinus ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseMinusMinus ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParsePlus ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParsePlusPlus ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseFunctionCall ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
+ private void ParseSetVar ()
+ {
+ throw new Exception ("The method or operation is not
implemented.");
+ }
+
private void Next ()
{
current = lexer.GetNext ();
Modified: trunk/olive/class/Mono.JScript.Compiler/Mono.JScript.Compiler.suo
===================================================================
(Binary files differ)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches