Beginnetje met type, misschien nog meer compound tokens maken zoals ==, <=, >= etc
authorMart Lubbers <mart@martlubbers.net>
Thu, 11 Feb 2016 14:44:56 +0000 (15:44 +0100)
committerMart Lubbers <mart@martlubbers.net>
Thu, 11 Feb 2016 14:44:56 +0000 (15:44 +0100)
lex.icl

diff --git a/lex.icl b/lex.icl
index f050062..34d913c 100644 (file)
--- a/lex.icl
+++ b/lex.icl
@@ -1,3 +1,40 @@
 module lex
 
+:: Token
+       //Values
+       = IdentToken String // Identifier
+       | NumberToken Int   // Integer
+       //Keywords
+       | VarToken          // var keyword
+       | VoidToken         // void keyword
+       | ReturnToken       // return keyword
+       | IfToken           // if keyword
+       | ElseToken         // else keyword
+       | WhileToken        // while keyword
+       | TrueToken         // True keyword
+       | FalseToken        // False keyword
+       //Single Characters
+       | BraceOpenToken    // (
+       | BraceCloseToken   // )
+       | CBraceOpenToken   // {
+       | CBraceCloseToken  // {
+       | SquareOpenToken   // [
+       | SquareCloseToken  // ]
+       | CommaToken        // ,
+       | ColonToken        // :
+       | SColonToken       // ;
+       | DotToken          // .
+       | PlusToken         // +
+       | DashToken         // -
+       | StarToken         // *
+       | SlashToken        // /
+       | PercentToken      // %
+       | EqualsToken       // =
+       | LesserToken       // <
+       | BiggerToken       // >
+       | ExclamationToken  // !
+       | AmpersandToken    // &
+       | PipeToken         // |
+       | SingleQuoteToken  // '
+
 Start = "Hello World!\n"