BadScript 2
Loading...
Searching...
No Matches
BadStaticKeys.cs
Go to the documentation of this file.
1
4
5namespace BadScript2.Common;
6
10public static class BadStaticKeys
11{
12 public const char QUOTE = '"';
13 public const char SINGLE_QUOTE = '\'';
14 public const string FORMAT_STRING_KEY = "$\"";
15 public const string MULTI_LINE_STRING_KEY = "@\"";
16 public const string MULTI_LINE_FORMAT_STRING_KEY = "$@\"";
17 public const string SINGLE_LINE_COMMENT = "//";
18 public const string MULTI_LINE_COMMENT_START = "/*";
19 public const string MULTI_LINE_COMMENT_END = "*/";
20 public const string VARIABLE_DEFINITION_KEY = "let";
21 public const string CONSTANT_DEFINITION_KEY = "const";
22 public const string SET_ACCESSOR_KEY = "set";
23 public const string GET_ACCESSOR_KEY = "get";
24 public const string STATIC_DEFINITION_KEY = "static";
25 public const string COMPILED_DEFINITION_KEY = "compiled";
26 public const string COMPILED_FAST_DEFINITION_KEY = "fast";
27 public const string INSTANCE_OF = "instanceof";
28 public const string IMPORT_KEY = "import";
29 public const string FROM_KEY = "from";
30 public const string EXPORT_KEY = "export";
31 public const string DELETE_KEY = "delete";
32 public const string DEFAULT_KEY = "default";
33 public const string LOCK_KEY = "lock";
34 public const string TRUE = "true";
35 public const string FALSE = "false";
36 public const string NULL = "null";
37 public const string NEW_KEY = "new";
38 public const string FUNCTION_KEY = "function";
39 public const string CLASS_KEY = "class";
40 public const string INTERFACE_KEY = "interface";
41 public const string WHILE = "while";
42 public const string RETURN_KEY = "return";
43 public const string REF_KEY = "ref";
44 public const string BREAK_KEY = "break";
45 public const string CONTINUE_KEY = "continue";
46 public const string THROW_KEY = "throw";
47 public const string IF_KEY = "if";
48 public const string ELSE_KEY = "else";
49 public const string SWITCH_KEY = "switch";
50 public const string CASE_KEY = "case";
51 public const string FOR_KEY = "for";
52 public const string FOR_EACH_KEY = "foreach";
53 public const string TRY_KEY = "try";
54 public const string CATCH_KEY = "catch";
55 public const string FINALLY_KEY = "finally";
56 public const string USING_KEY = "using";
57 public const string CONSTRUCTOR_NAME = ".ctor";
58 public const string BASE_KEY = "base";
59 public const string THIS_KEY = "this";
60 public const char DECIMAL_SEPARATOR = '.';
61 public const char NEGATIVE_SIGN = '-';
62 public const char ESCAPE_CHARACTER = '\\';
63 public const char STATEMENT_END_KEY = ';';
64 public const char BLOCK_END_KEY = '}';
65
66
67 public const string ARRAY_ACCESS_OPERATOR_NAME = "op_ArrayAccess";
68 public const string ARRAY_ACCESS_REVERSE_OPERATOR_NAME = "op_ArrayAccessReverse";
69 public const string INVOCATION_OPERATOR_NAME = "op_Invoke";
70 public const string ADD_ASSIGN_OPERATOR_NAME = "op_AddAssign";
71 public const string SUBTRACT_ASSIGN_OPERATOR_NAME = "op_SubtractAssign";
72 public const string MULTIPLY_ASSIGN_OPERATOR_NAME = "op_MultiplyAssign";
73 public const string EXPONENTIATION_ASSIGN_OPERATOR_NAME = "op_ExponentiationAssign";
74 public const string DIVIDE_ASSIGN_OPERATOR_NAME = "op_DivideAssign";
75 public const string MODULO_ASSIGN_OPERATOR_NAME = "op_ModuloAssign";
76 public const string ADD_OPERATOR_NAME = "op_Add";
77 public const string SUBTRACT_OPERATOR_NAME = "op_Subtract";
78 public const string MULTIPLY_OPERATOR_NAME = "op_Multiply";
79 public const string DIVIDE_OPERATOR_NAME = "op_Divide";
80 public const string MODULO_OPERATOR_NAME = "op_Modulo";
81 public const string EXPONENTIATION_OPERATOR_NAME = "op_Exponentiation";
82 public const string NEGATION_OPERATOR_NAME = "op_Negate";
83
84 public const string EQUAL_OPERATOR_NAME = "op_Equal";
85 public const string NOT_EQUAL_OPERATOR_NAME = "op_NotEqual";
86 public const string GREATER_OPERATOR_NAME = "op_Greater";
87 public const string GREATER_EQUAL_OPERATOR_NAME = "op_GreaterOrEqual";
88 public const string LESS_OPERATOR_NAME = "op_Less";
89 public const string LESS_EQUAL_OPERATOR_NAME = "op_LessOrEqual";
90
91
92 public const string IN_OPERATOR_NAME = "op_In";
93 public const string NOT_OPERATOR_NAME = "op_Not";
94 public const string POST_DECREMENT_OPERATOR_NAME = "op_PostDecrement";
95 public const string POST_INCREMENT_OPERATOR_NAME = "op_PostIncrement";
96 public const string PRE_DECREMENT_OPERATOR_NAME = "op_PreDecrement";
97 public const string PRE_INCREMENT_OPERATOR_NAME = "op_PreIncrement";
98
99 public static readonly char[] Whitespace =
100 {
101 ' ',
102 '\t',
103 };
104
105 public static readonly char[] NewLine =
106 {
107 '\r',
108 '\n',
109 };
110
111 public static IEnumerable<string> ReservedKeywords { get; set; } = new[]
112 {
116 LOCK_KEY,
117 TRUE,
118 FALSE,
119 NULL,
120 NEW_KEY,
122 CLASS_KEY,
124 WHILE,
126 BREAK_KEY,
128 THROW_KEY,
129 IF_KEY,
130 ELSE_KEY,
131 FOR_KEY,
133 TRY_KEY,
134 CATCH_KEY,
135 REF_KEY,
136 };
137
138 public static bool IsReservedKeyword(string keyword)
139 {
140 return ReservedKeywords.Contains(keyword);
141 }
142}
Contains Static Data for the BadScript Language.
const string ARRAY_ACCESS_REVERSE_OPERATOR_NAME
static readonly char[] Whitespace
static readonly char[] NewLine
static IEnumerable< string > ReservedKeywords
const string EXPONENTIATION_ASSIGN_OPERATOR_NAME
static bool IsReservedKeyword(string keyword)
Contains Shared Data Structures and Functionality.