#include<stdio.h>
int main() {
int x = 56;
printf("%d", x);
char ty;
scanf("%c", &ty);
float y = 0.454;
printf("+this must work(()");
}
prog.c:1:1: error: expected identifier or '(' before '%' token
%{
^
prog.c:7:1: error: expected identifier or '(' before '%' token
%%
^
prog.c:9:1: error: stray '\' in program
(\"\%d\")|(\"\%c\")|(\"\%s\") {printf("%s is a FORMAT SPECIFIER.\n", yytext);}
^
prog.c:9:1: error: stray '\' in program
prog.c:9:70: warning: missing terminating " character
(\"\%d\")|(\"\%c\")|(\"\%s\") {printf("%s is a FORMAT SPECIFIER.\n", yytext);}
^
prog.c:9:1: error: missing terminating " character
(\"\%d\")|(\"\%c\")|(\"\%s\") {printf("%s is a FORMAT SPECIFIER.\n", yytext);}
^
prog.c:10:1: error: stray '\' in program
\"(\\.|[^\\"])*\" {printf("%s is a STRING LITERAL.\n", yytext);}
^
prog.c:10:1: error: stray '\' in program
prog.c:10:1: error: stray '\' in program
prog.c:10:56: warning: missing terminating " character
\"(\\.|[^\\"])*\" {printf("%s is a STRING LITERAL.\n", yytext);}
^
prog.c:10:1: error: missing terminating " character
\"(\\.|[^\\"])*\" {printf("%s is a STRING LITERAL.\n", yytext);}
^
prog.c:12:2: error: expected identifier or '(' before string constant
("|")|("&")|("~")|("^") {printf("%s is a BITWISE OPERATOR.\n", yytext);}
^
prog.c:13:2: error: expected identifier or '(' before string constant
("=")|("+")|("-")|("/") {printf("%s is an ARITHMETIC OPERATOR.\n", yytext);}
^
prog.c:14:1: error: expected identifier or '(' before string constant
"<"|"<="|">="|">" {printf("%s is a RELATIONAL OPERATOR.\n", yytext);}
^
prog.c:15:1: error: expected identifier or '(' before string constant
"&&"|"||"|"!" {printf("%s is a LOGICAL OPERATOR.\n", yytext);}
^
prog.c:16:1: error: expected identifier or '(' before string constant
"{" {printf("%s is OPENING CURLY BRACE.\n", yytext);}
^
prog.c:17:1: error: expected identifier or '(' before string constant
"}" {printf("%s is CLOSING CURLY BRACE.\n", yytext);}
^
prog.c:18:1: error: expected identifier or '(' before string constant
"(" {printf("%s is OPENING BRACE.\n", yytext);}
^
prog.c:19:1: error: expected identifier or '(' before string constant
")" {printf("%s is CLOSING BRACE.\n", yytext);}
^
prog.c:20:1: error: expected identifier or '(' before string constant
";"|"," {printf("%s is a DELIMITER.\n", yytext);}
^
prog.c:21:1: error: expected identifier or '(' before string constant
"main"|"void"|"switch"|"if"|"else"|"for"|"while"|"break"|"continue"|"auto"|"static" {printf("%s is a RESERVED KEYWORD.\n", yytext);}
^
prog.c:22:1: error: expected identifier or '(' before '^' token
^#[a-z]+ {printf("%s is a PREPROCESSOR DIRECTIVE.\n", yytext);}
^
prog.c:22:2: error: stray '#' in program
^#[a-z]+ {printf("%s is a PREPROCESSOR DIRECTIVE.\n", yytext);}
^
prog.c:23:1: error: expected identifier or '(' before string constant
"<stdio.h>"|"<string.h>"|"<math.h>" {printf("%s is a HEADER FILE.\n", yytext);}
^
prog.c:24:1: error: expected identifier or '(' before string constant
"int"|"char"|"float"|"long"|"long long"|"double" {printf("%s is a DATATYPE.\n", yytext);}
^
prog.c:25:1: error: expected identifier or '(' before '[' token
[0-9]+ {printf("%s is an INTEGER NUMBER.\n", yytext);}
^
prog.c:26:1: error: expected identifier or '(' before '[' token
[0-9]+"."[0-9]+ {printf("%s is a DECIMAL NUMBER.\n", yytext);}
^
prog.c:27:1: error: expected identifier or '(' before '[' token
[a-zA-z_][a-zA-z_0-9]* {printf("%s is an IDENTIFIER.\n", yytext);}
^
prog.c:28:1: error: expected identifier or '(' before '[' token
[ \n\t] {}
^
prog.c:28:1: error: stray '\' in program
prog.c:28:1: error: stray '\' in program
prog.c:30:1: error: expected identifier or '(' before '%' token
%%
^
prog.c: In function 'main':
prog.c:37:2: error: unknown type name 'FILE'
FILE *f = fopen("3input.txt", "r");
^
prog.c:37:12: warning: implicit declaration of function 'fopen' [-Wimplicit-function-declaration]
FILE *f = fopen("3input.txt", "r");
^
prog.c:37:12: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
prog.c:38:2: error: 'yyin' undeclared (first use in this function)
yyin = f;
^
prog.c:38:2: note: each undeclared identifier is reported only once for each function it appears in
prog.c:39:2: warning: implicit declaration of function 'yylex' [-Wimplicit-function-declaration]
yylex();
^