Skip to content

msan19/Functional-Graph-Language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Functional Graph Language

fgl

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.

Running the Compiler

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.

Compiler Arguments

  • help shows all possible compiler arguments with a short description
  • throw the compiler does not handle exceptions (used when debugging the compiler itself)
  • noWrite the output is no longer saved in a .gml file
  • project uses the input and output folders used in the .sln project
  • parseTree prints the parse tree to the console
  • code prints the source code to the console
  • output prints the output to the console

Folder Structure

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

About

Functional Graph Language (FGL) is a domain specific language for intentional definition and generation of graphs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published