-
Notifications
You must be signed in to change notification settings - Fork 0
/
tokens_lexico.txt
executable file
·156 lines (117 loc) · 2.29 KB
/
tokens_lexico.txt
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
**KEYWORDS
BEGIN BEGIN
END END
VAR VAR
INTEGER INTEGER
DOUBLE DOUBLE
STRING STRING
BOOLEAN BOOLEAN
FOR FOR
WHILE WHILE
REPEAT REPEAT
IF IF
ELSE ELSE
THEN
UNTIL
PROCEDURE PROCEDURE
FUNCTION FUNCTION
CALL CALL
MOD MOD
DIV DIV
AND AND
OR OR
NOT NOT
NULL NULL
TRUE T
FALSE F
MODOVALOR E
MODOREFERENCIA ES
LENGHT LENGHT
RECORD RECORD
STACK STACK
QUEUE QUEUE
GRAPH GRAPH
LIST LIST
ADD ADD
REMOVE REMOVE
SIZE SIZE
GET GET
ENQUEUE ENQUEUE
DEQUEUE DEQUEUE
GET_Q GET_Q
SIZE_QUEUE SIZE_QUEUE
PUSH PUSH
POP POP
GET_P GET_P
SIZE_STACK SIZE_STACK
ADD_NODE ADD_NODE
ADD_TRANS ADD_TRANS
REMOVE_NODE REMOVE_NODE
REMOVE_TRANS REMOVE_TRANS
WIDTH WIDTH
DEEP DEEP
WRITELN WRITELN
FLOOR FLOOR
CEIL CEIL
TO TO
DO DO
+++++++++++++++++++++++++++++
ID : STACK
ID : QUEUE
ID : GRAPH
ID : LIST
----------- LIST ---------------------
ADD(LISTA , Valor);
REMOVE(LISTA, Valor);
SIZE(LISTA); ---> retorna
GET(LISTA, Posicion) ---> retorna
------------- QUEUE ---------------------
ENQUEUE(COLA, Valor); --> ENCOLAMOS
DEQUEUE(COLA); --> Retornamos eliminando
GET_Q(COLA); --> Retornamos sin eliminar
SIZE_QUEUE(COLA); --> Retornamos tamano de la cola
------------ STACK ----------------------
PUSH(PILA,VALOR);
POP(PILA,VALOR);
GET_P(PILA);
SIZE_STACK(PILA);
------------GRAPH----------------------------
ADD_NODE(GRAPH,VALOR);
ADD_TRANS(GRAPH,VALOR,VALOR,VALOR);
REMOVE_NODE(GRAPH,VALOR);
REMOVE_TRANS(GRAPH,VALOR,VALOR,VALOR);
DEEP(GRAPH);
WIDTH(GRAPH);
RECORD ID
BEGIN
ID : TIPO
ID2 : TIPO
.
.
.
END
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID r'[a-zA-Z_][a-zA-Z_0-9]*'
INTEGERVAL r'\d+'
STRINGVAL r'\"(\s*\w*\_*\+*\-*\.*\,*\€*\!*\@*\#*\$*\%*\^*\&*\**\(*\)*\;*\:*\\*\/*\|*\<*\>*\!*\¡*\?*\¿*\}*\{*\[*\]*\~*)*\"' # Recordar tomar en cuenta los saltos de linea
DOUBLEVAL r'\d+\.\d+'
COMENTARIO r'\#.*'
ASIGNACION <-- r'\<--'
POR * r'\*'
DIVIDIR / r'\/'
MAS + r'\+'
MENOS - r'-'
PA ( r'\('
PC ) r'\)'
MENORIGUAL <= r'\<\='
MENOR < r'\<'
MAYORIGUAL >= r'\>\='
MAYOR > r'\>'
IGUAL = r'\='
DIFERENTE != r'\!\='
ARRAY [] r'\[\d+\]'
SUBARRAY [12312 .. 12312] r'\[\d+\s*\.\.\s*\d+\]'
PUNTOCOMA r'\;'
PUNTO r'\.'
DOSPUNTOS r'\:'
COMA r'\,'