Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %option noyywrap
- %{
- #include <stdio.h>
- #include <stdlib.h>
- %}
- nazw [a-zA-z]([a-zA-Z0-9_]*)
- liczb [0-9]+
- %%
- [\n\;\*\,\[\]] {
- return *yytext;
- }
- [ \t] { }
- "char" {
- return CHAR;
- }
- "int" {
- return INT;
- }
- "float" {
- return FLOAT;
- }
- "double" {
- return DOUBLE;
- }
- {nazw} {
- yylval.tekst = strdup(yytext);
- return NAZWA;
- }
- {liczb} {
- yylval.numer = atoi(yytext);
- return ROZMIAR;
- }
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement