-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtokens.py
68 lines (66 loc) · 1.4 KB
/
tokens.py
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
# Omar Iván Flores Quijada
# Esteban Arocha Ortuño
# Enero - Mayo 2019
# ITESM
VAR = "var"
CTE = "cte"
FUN = "fun"
ARR = "arr"
GLOBAL = "global"
TYPE = "tipo"
VARS = "vars"
PARAMS = 'params'
VOID = "void"
INT = 'int'
FLOAT = 'float'
CHAR = 'char'
BOOL = 'bool'
STRING = 'str'
PLUS = '+'
MINUS = '-'
MULT = '*'
DIV = '/'
EQU = '=='
GREATER = '>'
GREATER_EQ = '>='
LESS = '<'
LESS_EQ = '<='
DIFF = '!='
AND = '&&'
OR = '||'
ASSIGN = '='
ERROR = 'error'
PRINT = 'print'
PRINT_NEW_LINE = 'print_new_line'
READ = 'read'
RETURN = 'return'
GO_TO_F = 'go_to_f'
GO_TO = 'go_to'
START = 'start'
END_PROC = 'end_proc'
ERA = 'era'
GO_SUB = 'go_sub'
FILL_ARRAY = 'fill_array'
VER = 'ver'
PLUS_POINTER = "plus_pointer"
ASSIGN_PARAM = 'assign_param'
ASSIGN_ARRAY_PARAM = '= array_param'
INI_VAR = 'ini_var'
POW = 'pow'
SQRT = 'sqrt'
MODE = 'mode'
PROB = 'prob'
MOMENT = 'moment'
MEDIAN = 'median'
VAR = 'var'
EXP_BERNOULLI = 'exp_ber'
VAR_BERNOULLI = 'var_ber'
PROB_BINOMIAL = 'prob_binomial'
PROB_GEOMETRIC = 'prob_geometric'
EXP_BINOMIAL = 'exp_binomial'
VAR_BINOMIAL = 'var_binomial'
PROB_GEOMETRIC = 'prob_geometric'
EXP_GEOMETRIC = 'exp_geometric'
VAR_GEOMETRIC = 'var_geometric'
PLOT_HISTOGRAM = 'plot_histogram'
SPECIAL_TOKENS = ['pow', 'sqrt', 'mode', 'prob', 'moment', 'median', 'var', 'exp_bernoulli', 'var_bernoulli', 'prob_binomial', 'exp_binomial', 'var_binomial', 'prob_geometric', 'exp_geometric', 'var_geometric', 'plot_histogram']