brk's People
Forkers
datakindsbrk'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.
Find a decent test framework and write tests for the lexer & parser.
Ideas for testing frameworks:
Testing is important for compilers, they will in a sense define the language, the tests will check for correct code and detect incorrect code.
This might be a good opportunity to try out TDD as well..
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
Expression codegen
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.
Create basic types
Parse statements
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.
Using Integer expression after a floating point expression crashes Brk
Example Brk code that would skip the 1 completely:
55.54 + 123.2;
1 + 2;
Example Brk code that would cause Brk to crash:
55.54 + 123.2;
12;
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.