fix scanner error
This commit is contained in:
parent
ee5791b1c8
commit
29b5b6c1f3
5 changed files with 26 additions and 1 deletions
|
|
@ -182,7 +182,6 @@ BLOCK_COMMENT \/\*(.|\n)*?\*\/
|
||||||
. {
|
. {
|
||||||
errors += 1;
|
errors += 1;
|
||||||
fprintf(stderr, "Error type A at Line %d: Mysterious character \"%s\".\n", yylineno, yytext);
|
fprintf(stderr, "Error type A at Line %d: Mysterious character \"%s\".\n", yylineno, yytext);
|
||||||
return YYerror;
|
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
|
|
||||||
5
test1
Normal file
5
test1
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i = 1;
|
||||||
|
int j = ~i;
|
||||||
|
}
|
||||||
7
test2
Normal file
7
test2
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
float a[10,2];
|
||||||
|
int i;
|
||||||
|
a[5,3] = 1.5;
|
||||||
|
if (a[1][2] == 0) i = 1 else i = 0;
|
||||||
|
}
|
||||||
5
test3
Normal file
5
test3
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
int inc()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
i = i + 1;
|
||||||
|
}
|
||||||
9
test4
Normal file
9
test4
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
struct Complex
|
||||||
|
{
|
||||||
|
float real, image;
|
||||||
|
};
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
struct Complex x;
|
||||||
|
y.image = 3.5;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue