-
-
Save piotrbla/7b940c19846247b63833f327f2628d6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
#include <stdio.h> | |
#include "y.tab.h" | |
%} | |
%% | |
\=\= {return EQ;} | |
\!\= {return NEQ;} | |
\<\= {return LEQ;} | |
\>\= {return GEQ;} | |
\< {return '>';} | |
\> {return '<';} | |
\= {return '=';} | |
\+ {return '+';} | |
\- {return '-';} | |
\* {return '*';} | |
\/ {return '/';} | |
\; {return ';';} | |
"int" {return INT;} | |
"if" {return IF;} | |
"else" {return ELSE;} | |
[A-Za-z_][A-Za-z0-9_]* {return ID;} | |
[1-9][0-9]*|0 {return NUM;} | |
%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment