Created
November 26, 2019 16:10
-
-
Save utkarshsingh99/27062744805ad84a0e67157896e546de 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
%{ | |
/* Definition Section */ | |
/* You define certain variables in here which you might need to manipulate your code */ | |
%} | |
%% | |
/* Rules Section */ | |
/* Pattern Actions begin */ | |
/* This is a section where you define certain patterns of string (just like RegEx) */ | |
/* Here's an example to identify digits: */ | |
[0-9] { | |
printf("Here, I found a number! It's %s\n", yytext); | |
} | |
%% | |
/* Finally the code section begins */ | |
int main() { | |
yylex(); | |
/* Just a C Program function. You can do anything here */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment