Started implementing OnGoto Statement. Added reserved work On. Created skeleton of...
authorMichael Welch <michaelgwelch@gmail.com>
Sat, 3 Feb 2007 17:48:04 +0000 (17:48 +0000)
committerMichael Welch <michaelgwelch@gmail.com>
Sat, 3 Feb 2007 17:48:04 +0000 (17:48 +0000)
mbasic/Program.cs
mbasic/SyntaxTree/OnGoto.cs [new file with mode: 0644]
mbasic/Token.cs

index bb86268..d835c7e 100644 (file)
@@ -219,6 +219,7 @@ namespace mbasic
             symbols.ReserveWord("INPUT", Token.Input);
             symbols.ReserveWord("LET", Token.Let);
             symbols.ReserveWord("NEXT", Token.Next);
+            symbols.ReserveWrod("ON", Token.On);
             symbols.ReserveWord("OPTION", Token.Option);
             symbols.ReserveWord("PRINT", Token.Print);
             symbols.ReserveWord("READ", Token.Read);
diff --git a/mbasic/SyntaxTree/OnGoto.cs b/mbasic/SyntaxTree/OnGoto.cs
new file mode 100644 (file)
index 0000000..7a25fa2
--- /dev/null
@@ -0,0 +1,44 @@
+/*******************************************************************************
+    Copyright 2007 Michael Welch
+    
+    This file is part of MBasic99.
+
+    MBasic99 is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    MBasic99 is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with MBasic99; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*******************************************************************************/
+
+namespace mbasic.SyntaxTree
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Reflection.Emit;
+
+    class OnGoto : Statement
+    {
+        private List<string> targets;
+
+        public OnGoto(Expression number, List<string> targets, LineId line)
+            : base(line)
+        {
+        }
+
+        public void CheckType()
+        {
+        }
+
+        public void Emit(ILGenerator gen)
+        {
+        }
+    }
+}
index e157dc1..c7f8d71 100644 (file)
@@ -60,6 +60,7 @@ internal enum Token
     Not,
     NotEquals,
     Number,
+    On,
     Or,
     Option,
     Print,
@@ -76,4 +77,4 @@ internal enum Token
     To,
     Variable
 
-}
\ No newline at end of file
+}