Skip to content
Abe Pralle edited this page Nov 26, 2021 · 20 revisions

Links

.froley Files

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".

Comments

There are four types of comments in Froley:

# Single-line comment
#{ Multi-line comment }#
==== Single-line "HR" comment
---- Single-line "HR" comment

Sections

A .froley file is comprised of three sections:

Generated Files

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.

Clone this wiki locally