-
Notifications
You must be signed in to change notification settings - Fork 35
/
IndentedWhileTokenGeneric.cs
127 lines (77 loc) · 3.17 KB
/
IndentedWhileTokenGeneric.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
using sly.lexer;
namespace csly.indentedWhileLang.parser
{
[Lexer(IndentationAWare = true, Indentation = "\t")]
public enum IndentedWhileTokenGeneric
{
#region keywords 0 -> 19
[Lexeme(GenericToken.KeyWord, "IF")] [Lexeme(GenericToken.KeyWord, "if")]
IF = 1,
[Lexeme(GenericToken.KeyWord, "THEN")] [Lexeme(GenericToken.KeyWord, "then")]
THEN = 2,
[Lexeme(GenericToken.KeyWord, "ELSE")] [Lexeme(GenericToken.KeyWord, "else")]
ELSE = 3,
[Lexeme(GenericToken.KeyWord, "WHILE")] [Lexeme(GenericToken.KeyWord, "while")]
WHILE = 4,
[Lexeme(GenericToken.KeyWord, "DO")] [Lexeme(GenericToken.KeyWord, "do")]
DO = 5,
[Lexeme(GenericToken.KeyWord, "SKIP")] [Lexeme(GenericToken.KeyWord, "skip")]
SKIP = 6,
[Lexeme(GenericToken.KeyWord, "TRUE")] [Lexeme(GenericToken.KeyWord, "true")]
TRUE = 7,
[Lexeme(GenericToken.KeyWord, "FALSE")] [Lexeme(GenericToken.KeyWord, "false")]
FALSE = 8,
[Lexeme(GenericToken.KeyWord, "NOT")] [Lexeme(GenericToken.KeyWord, "not")]
NOT = 9,
[Lexeme(GenericToken.KeyWord, "AND")] [Lexeme(GenericToken.KeyWord, "and")]
AND = 10,
[Lexeme(GenericToken.KeyWord, "OR")] [Lexeme(GenericToken.KeyWord, "or")]
OR = 11,
[Lexeme(GenericToken.KeyWord, "PRINT")] [Lexeme(GenericToken.KeyWord, "print")]
PRINT = 12,
[Lexeme(GenericToken.KeyWord, "RETURN")] [Lexeme(GenericToken.KeyWord, "return")]
RETURN = 13,
#endregion
#region literals 20 -> 29
[Mode(ModeAttribute.DefaultLexerMode, "fstringExpression")]
[Lexeme(GenericToken.Identifier, IdentifierType.AlphaNumericDash)]
IDENTIFIER = 20,
[Lexeme(GenericToken.Int)] INT = 22,
#endregion
#region operators 30 -> 49
[Lexeme(GenericToken.SugarToken, ">")] GREATER = 30,
[Lexeme(GenericToken.SugarToken, "<")] LESSER = 31,
[Lexeme(GenericToken.SugarToken, "==")]
EQUALS = 32,
[Lexeme(GenericToken.SugarToken, "!=")]
DIFFERENT = 33,
[Lexeme(GenericToken.SugarToken, ".")] CONCAT = 34,
[Lexeme(GenericToken.SugarToken, ":=")]
ASSIGN = 35,
[Lexeme(GenericToken.SugarToken, "+")] PLUS = 36,
[Lexeme(GenericToken.SugarToken, "-")] MINUS = 37,
[Lexeme(GenericToken.SugarToken, "*")] TIMES = 38,
[Lexeme(GenericToken.SugarToken, "/")] DIVIDE = 39,
#endregion
#region sugar 50 ->
[Lexeme(GenericToken.SugarToken, ";")] SEMICOLON = 52,
[SingleLineComment("#")] COMMENT = 1236,
#endregion
#region fstring 100 ->
[Push("fstringExpression")] [Mode("fstring")] [Sugar("{")]
OPEN_FSTRING_EXPPRESSION = 100,
[Pop] [Mode("fstringExpression")] [Sugar("}")]
CLOSE_FSTRING_EXPPRESSION = 101,
[Sugar("$\"")]
[Push("fstring")]
OPEN_FSTRING,
[Sugar("\"")]
[Mode("fstring")]
[Pop]
CLOSE_FSTRING,
[Mode("fstring")]
[UpTo("{","\"")]
FSTRING_CONTENT
#endregion
}
}