Coverage for skema/program_analysis/CAST/matlab/tokens.py: 100%
3 statements
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-30 17:15 +0000
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-30 17:15 +0000
1""" all the tokens from the Waterloo model syntax tree """
3""" Waterloo model syntax keywords """
4KEYWORDS = [
5 # keywords we currently support
6 'arguments',
7 'assignment',
8 'binary_operator',
9 'block',
10 'boolean',
11 'boolean_operator',
12 'case',
13 'case_clause',
14 'cell',
15 'command',
16 'command_argument',
17 'command_name',
18 'comment',
19 'comparison_operator',
20 'else',
21 'else_clause',
22 'elseif',
23 'elseif_clause',
24 'end',
25 'function',
26 'function_arguments',
27 'function_call',
28 'function_definition',
29 'function_output',
30 'identifier',
31 'if',
32 'if_statement',
33 'matrix',
34 'module'
35 'not_operator',
36 'number',
37 'otherwise',
38 'otherwise_clause',
39 'parenthesis',
40 'postfix_operator',
41 'row',
42 'source_file',
43 'spread_operator',
44 'string',
45 'string_content',
46 'switch',
47 'switch_statement',
48 'unary_operator',
50 # keywords currently being added
51 'break_statement',
52 'continue_statement',
53 'for',
54 'for_statement',
55 'iterator',
56 'range',
58 # keywords to be supported
59 'field_expression',
60 'lambda',
61 'line_continuation',
62 'multioutput_variable',
63]
65""" anything not a keyword """
66OTHER_TOKENS = [
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]
98""" all tokens """
99TOKENS = KEYWORDS + OTHER_TOKENS