Difference between revisions of "ANTLR/GettingStarted"
From Kompilatory
(Marked this version for translation) |
|||
Line 1: | Line 1: | ||
<translate> | <translate> | ||
<languages/> | <languages/> | ||
− | == Start == | + | == Start == <!--T:1--> |
+ | <!--T:2--> | ||
# run '''java -jar /opt/antlr3/antlrworks.jar''' | # run '''java -jar /opt/antlr3/antlrworks.jar''' | ||
# do not fill the questionnaire (the Author do not care about it anymore) | # do not fill the questionnaire (the Author do not care about it anymore) | ||
# choose the type of the file: .g and create it | # choose the type of the file: .g and create it | ||
+ | <!--T:3--> | ||
[[File:AntlrWorks1.PNG|none]] | [[File:AntlrWorks1.PNG|none]] | ||
+ | <!--T:4--> | ||
[[File:AntlrWorks2.PNG|none]] | [[File:AntlrWorks2.PNG|none]] | ||
+ | <!--T:5--> | ||
Under the Linux & kde we cannot enter the grammar name. But if we click 'OK' button, the program will tell what it thinks about us. | Under the Linux & kde we cannot enter the grammar name. But if we click 'OK' button, the program will tell what it thinks about us. | ||
+ | <!--T:6--> | ||
[[File:AntlrWorks3.PNG|none]] | [[File:AntlrWorks3.PNG|none]] | ||
+ | <!--T:7--> | ||
Now the writing in the 'name' field is possible. | Now the writing in the 'name' field is possible. | ||
+ | <!--T:8--> | ||
I advise to NOT give spaces in names (of files or directories) - it leads to troubles in the (near) future. | I advise to NOT give spaces in names (of files or directories) - it leads to troubles in the (near) future. | ||
Now choose the type of the grammar 'Combined Grammar'. There are also 'Lexer', 'Parser' & 'Tree' grammars but today we need the first one. | Now choose the type of the grammar 'Combined Grammar'. There are also 'Lexer', 'Parser' & 'Tree' grammars but today we need the first one. | ||
+ | <!--T:9--> | ||
[[File:AntlrWorks2a.PNG|none]] | [[File:AntlrWorks2a.PNG|none]] | ||
+ | <!--T:10--> | ||
Additionally we can choose some lexems to create. Today the ones underscored on the above figure will be needed. After the 'OK' button we'll got the text of the lexical analyzer with the words (lexems) chosen. <big><span style="color: Red">Now the saving of the program is very recommended.</span></big> | Additionally we can choose some lexems to create. Today the ones underscored on the above figure will be needed. After the 'OK' button we'll got the text of the lexical analyzer with the words (lexems) chosen. <big><span style="color: Red">Now the saving of the program is very recommended.</span></big> | ||
</translate> | </translate> |
Latest revision as of 12:42, 10 May 2016
Start
- run java -jar /opt/antlr3/antlrworks.jar
- do not fill the questionnaire (the Author do not care about it anymore)
- choose the type of the file: .g and create it
Under the Linux & kde we cannot enter the grammar name. But if we click 'OK' button, the program will tell what it thinks about us.
Now the writing in the 'name' field is possible.
I advise to NOT give spaces in names (of files or directories) - it leads to troubles in the (near) future. Now choose the type of the grammar 'Combined Grammar'. There are also 'Lexer', 'Parser' & 'Tree' grammars but today we need the first one.
Additionally we can choose some lexems to create. Today the ones underscored on the above figure will be needed. After the 'OK' button we'll got the text of the lexical analyzer with the words (lexems) chosen. Now the saving of the program is very recommended.