Code Monkey home page Code Monkey logo

automatoninterpreter's Introduction

Automaton Interpreter

Description: Base code for creating automaton interpreters.

  • Developed in C# .Net Core 3.1
  • Cross Platform (Windows, Linux, MacOS)
  • Status: Currently the project only contains code for a deterministic stack automaton.

Dependencies

Installation

Download and install .Net Core 3.1 .Net Core Install instructions. You can use any IDE you feel confortable editing, but Visual Studio is preferred.

Configuration

The logging output can be configured setting the environment variable "AUTOMATON_LOG_PRESET" according to the following enum:

    [Flags]
    public enum LogConfigEnum
    {
        CONSOLE_DEFAULT = 0b0000_0001, // 1
        CONSOLE_COLORED = 0b0000_0010, // 2
        CONSOLE_ERRORS  = 0b0000_0100, // 4
        CONSOLE_DEBUG   = 0b0000_1000, // 8
        FILE            = 0b0001_0000, // 16

        // ---
        DEFAULT        = CONSOLE_DEFAULT,                                         // 5
        IMPROVED       = CONSOLE_COLORED | CONSOLE_ERRORS                 | FILE, // 22
        DEBUG_IMPROVED = CONSOLE_COLORED | CONSOLE_ERRORS | CONSOLE_DEBUG | FILE  // 30
    }

Example:

  • Linux:
export AUTOMATON_LOG_PRESET=6
  • Windows:
setX AUTOMATON_LOG_PRESET 22

Usage

Execution:

$ ./apd exemplo.json

Input file example:

{
  "ap": [
    [ "i", "d" ],
    [ "0", "1" ],
    [ "Z", "U", "F" ],
    [
      [ "i", "0", "#", "d", "ZF" ],
      [ "i", "1", "#", "d", "UF" ],
      [ "d", "0", "Z", "d", "ZZ" ],
      [ "d", "0", "U", "d", "#" ],
      [ "d", "1", "U", "d", "UU" ],
      [ "d", "1", "Z", "d", "#" ],
      [ "d", "#", "F", "i", "#" ]
    ],
    "i",
    [ "i" ]
  ]
}

How to test the software

For compiling the code use the following commands:

  • Linux:

    • option 1:
      $ dotnet publish App/App.csproj /p:PublishProfile=App/Properties/PublishProfiles/LinuxX64.pubxml
    • option 2:
      $ dotnet publish App/App.csproj -c Release -r linux-x64 /p:PublishSingleFile=true --output ./bin/LinuxX64
  • Windows:

    • option 1:
      > dotnet publish App/App.csproj /p:PublishProfile=App/Properties/PublishProfiles/WinX64.pubxml
    • option 2:
      > dotnet publish App/App.csproj -c Release -r win-x64 /p:PublishSingleFile=true --output ./bin/WindowsX64
  • Windows X86:

    • option 1:
      > dotnet publish App/App.csproj /p:PublishProfile=App/Properties/PublishProfiles/WinX86.pubxml

For custom compilation settings search .Net Build Instructions


Contributors

  • Matheus Dutra Cerbino

ISSUES

If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.


Credits and references

  1. Project made as a homework for "LINGUAGENS FORMAIS E AUTÔMATOS" class of CEFET-MG college.
  2. Project GitHub GitHub

automatoninterpreter's People

Contributors

pinacolada8 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.