-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Abe Pralle edited this page Nov 26, 2021
·
20 revisions
A .froley file is used to define token types and write the logic for the Scanner and Parser. Name it with the name of the language you're defining - for example, Simple.froley for a language called "Simple".
There are four types of comments in Froley:
# Single-line comment
#{ Multi-line comment }#
==== Single-line "HR" comment
---- Single-line "HR" comment
A .froley file is comprised of three sections:
Compiling a .froley file generates the following files. Check the top header of each to see if custom changes will be overwritten on a Froley recompile.
| File | Description |
|---|---|
<LanguageName>.rogue |
Main file/program entry point (only if the --main option is given). |
CompileError.rogue |
Standard Error/Exception class. |
TokenType.rogue |
Token type enumeration (IDENTIFER=1, STRING=2, etc.). |
Token.rogue |
Token class definition. |
ScannerCore.rogue |
Core logic for Scanner. Overwritten whenever the .froley file is changed. |
Scanner.rogue |
Extended ScannerCore. Make custom scanner modifications here. |
ParserCore.rogue |
Core logic for Parser. Overwritten whenever the .froley file is changed. |
Parser.rogue |
Extended ParserCore. Make custom parser modifications here. |
Cmd.rogue |
Extended Cmd node definitions generated by Froley. |
Vistor.rogue |
Base Visitor class for analyzing the AST output of the parser. Refer to the Visitor API for more details. |
ScanTable.rogue |
Internal use. |
FrameStack.rogue |
Internal use. |