Giter Site home page Giter Site logo

brk's People

Contributors

brokenprogrammer avatar datakinds avatar

Watchers

 avatar  avatar

Forkers

datakinds

brk's Issues

Finish language definition

It is much easier to write a parser if the language have a clear definition.

The definition should be in some "ENBF-ish" grammar and clear enough that the implementation of the parser can begin.

Update the makefile to properly include the llvm libraries.

Current solution is pure copypaste of what Brk needs from llvm which simply wont do.. There is llvm commands that works in the terminal but not using the makefile such as llvm-config --cxxflags

Fix this so its easier for me to work on diff machines.

Parentheses return nullptr when parsed.

'(' expression ')' is being parsed using e = parseExpression(); and when returned from the parseUnaryExpression function the unique_ptr is a nullptr and the compiler crashes.

Code for the parens expressions is found at line 187 in parse.cpp

Lexer error handling

The lexer currently only have //Error comments at the places where it should log some form of error or handle some error. This needs to be added to improve debugging when using Brk and developing Brk.

Parser error handling

The parser currently only have //Error comments at the places where it should log some form of error or handle some error. This needs to be added to improve debugging when using Brk and developing Brk.

Parse expressions

Since the expressions have an initially defined grammar it can now be parsed so lets implement the parsing logic for expressions and then write tests that also evaluate the parsed expressions such as:

  • 1
  • (1)
  • (1 + 2)
  • (1 - 2- 3)
  • (2 * 3 - 5 * 4)
  • 2 * (3-5) * 4
  • -1
  • 2+-3

These tests will allow us to see that parentheses expressions work as they should and that the precedence work as intended as well.
This will also allow me to get an overview of how the parser should be structured and I can also tune the lexer and token class while this is being done.

Improve Lexer structure.

Some missed tokens are currently not being lexed which needs to be fixed. At the same time as I'm fixing this I might as well improove the lexing by re-implementing the Token struct as a linked or doubly linked list.

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.