File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ int line_input_pos;
20
20
FILE * in_fp ;
21
21
22
22
/* Function Declarations */
23
+ void addChar ();
24
+ void getChar ();
25
+ void getNonBlank ();
26
+ int lex ();
27
+
28
+ void factor ();
29
+ void z ();
30
+ void x ();
23
31
24
32
/* Character Classes */
25
33
#define LETTER 0
@@ -123,6 +131,37 @@ int lex()
123
131
return nextToken ;
124
132
}
125
133
134
+ void factor ()
135
+ {
136
+ if (nextToken == IDENT || nextToken == INT_LIT )
137
+ /* Return nextToken */
138
+ lex ();
139
+ else
140
+ {
141
+ if (nextToken == LEFT_PAREN )
142
+ {
143
+ lex ();
144
+ x ();
145
+ if (nextToken == RIGHT_PAREN )
146
+ lex ();
147
+ else
148
+ error ("Expected )" );
149
+ }
150
+ else
151
+ error ("Expected id, integer literal, or (" );
152
+ }
153
+ }
154
+
155
+ void z ()
156
+ {
157
+
158
+ }
159
+
160
+ void x ()
161
+ {
162
+
163
+ }
164
+
126
165
/* Main Driver */
127
166
main () {
128
167
You can’t perform that action at this time.
0 commit comments