FGL is a purely functional language that leans on the syntax of mathematics. It uses set-builder notation to construct sets, and graphs are constructed using the formula G = (V,E,src,dst). An FGL file is compiled to GML code, and because of the compiler's component architecture, other formats like DOT can be added with relative ease.
Opening the Compiler.sln file in the folder Compiler will result in all projects being opened. When opened the startup project should be set to Main.
The .flg file which is parsed is specified in the function ParseArgs
found in Compiler/src/Main/Program.cs.
The file which is specified here is found in Compiler/src/Main/InputFiles.
It is possible to add new .fgl files here and reference them in ParseArgs
.
If the .sln file is open using Visual Studio 2019, two debug profiles will be available, Main
and Exception Catched
.
Main
runs the compiler with the following arguments: throw and project.Exception Catched
runs the compiler with the following arguments: help, code, project, and output.
help
shows all possible compiler arguments with a short descriptionthrow
the compiler does not handle exceptions (used when debugging the compiler itself)noWrite
the output is no longer saved in a .gml fileproject
uses the input and output folders used in the .sln projectparseTree
prints the parse tree to the consolecode
prints the source code to the consoleoutput
prints the output to the console
The following folder structure is founder the folder Compiler.
All source code is found in the folder src where each subfolder is a .NET Core 3.1 project. All Testing is found in the folder Tests which is split up into Unit- and Integration Tests.
- src
- ASTLib
- FileGeneratorLib
- FileUtilities
- InterpreterLib
- LexParserLib
- Main
- ReferenceHandlerLib
- TypeCheckerLIb
- Tests
- Unit Testing
- ASTLib.Tests
- FileGeneratorLib.Tests
- FileUtilities.Tests
- InterpreterLib.Tests
- LexParserLib.Tests
- Main.Tests
- ReferenceHandlerLib.Tests
- TypeCheckerLIb.Tests
- IntegrationTesting
- Single Component
- SingleCompIntepreterLib.Tests
- SingleCompReferenceHandlerLib.Tests
- SingleCompTypeCheckerLib.Tests
- Multiple Component
- IntepreterAndGmlGenerator.Tests
- ReferenceHandlerAndTypeChecker.Tests
- TypeCheckerAndIntepreter.Tests
- Single Component
- Unit Testing