Giter Site home page Giter Site logo

lurk's Introduction

lurk

An interpreter for a fictional language.

About

This interpreter parses Krul source code files (*.txt) and executes the matched expressions. When a file ends, the last value is used as the file name of the file that is yet to be parsed. Execution of the Krul program will stop when an end expression is interpreted. For more information about all the possible expressions, have a look at the following chapter.

This interpreter was originally a university assignment, but I decided to take it a step further and overengineer it.

Configuration

The lurk program is constructed with the following configuration:

interface ISettings {
    useLocalPath: boolean; // Use the local source code files (src/resources).
    sourcePath: string; // Local path (src/resources) or online path.
    expressionPath: string; // The path where expressions are located (src/core/expressions).
    currentSource: string; // The current source code file that is being executed.
}

Expressions

A list of all possible expressions that Lurk supports.

Function

  • End of search - end
  • Function - fun
  • Return - ret

Integer

  • Absolute - abs
  • Add - add
  • Decrement - dec
  • Divide - div
  • Increment - inc
  • Modulo - mod
  • Multiply - mul
  • Negate - neg
  • Subtract - sub

Jump

  • Go to - gto
  • Go to if equal - geq
  • Go to if greater - ggt
  • Go to if greater or equal - gge
  • Go to if less - glt
  • Go to if less or equal - gle
  • Go to if not equal - gne

String

  • Concatenation - cat
  • Duplicate - dup
  • Index - idx
  • Length - len
  • New line - enl
  • Reverse - rev
  • Rotate - rot
  • Substring - slc

Value

  • Assign variable - =
  • Digit - \d
  • Label definition - :
  • Label reference - >
  • Variable reference - $
  • Text - \

License

MIT

lurk's People

Contributors

cornayy avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 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.