Git Product home page Git Product logo

ape-lang-compiler's Introduction

Danil Andreev

3D Graphics Engieneer

Hi there πŸ‘‹

Greetings, my name is Danil Andreev, I am 3D graphics programmer from Kyiv, UkraineπŸ‡ΊπŸ‡¦.

πŸ”­ I’m currently working on:

My role

3D Research Engieneer:

  • RHI development & support
  • 3D Rendering programming
  • Profiling & optimising 3D graphics pipeline

🌱 I’m currently learning ...

Ray tracing pipelines

Gists

πŸ“« How to reach me

ape-lang-compiler's People

Contributors

danilandreev avatar

Stargazers

 avatar

Watchers

 avatar

ape-lang-compiler's Issues

Create Abstract Syntax Tree validator

Feature request

Is your feature request related to a problem? Please describe.

Add mechanism to validate Abstract Syntax Tree got from Tokenizer::parse() to ensure that used variables has been declared, etc.

Describe the solution you'd like 🌟

New class or method in Tokenizer class.

Describe alternatives you've considered 🐾

None

Additional context πŸ‘:

Create syntax analyzer

Feature request

Is your feature request related to a problem? Please describe.

Create syntax analyzer module for building an Abstract Syntax Tree.

Describe the solution you'd like 🌟

Node system:

  • Create class for syntax node.
  • Each node should contain 3 or more operators, value and its type.
  • Type must be represented as enumeration.
  • Syntax tree building can use recursive methods.

Describe alternatives you've considered 🐾

None

Additional context πŸ‘:

Graphical representation of tree

image

Source code

while b β‰  0
  if a > b
    a := a βˆ’ b
  else
    b := b βˆ’ a
return a

Add shared pointers to tokenizer node logic

Describe the bug πŸ‘€

On error tokenizer does not release allocated memory for nodes.

How to reproduce πŸƒ:

  1. Try to compile incorrect program.
  2. See that nodes are not deleted after exception throwing.

Expected behavior πŸ™Œ

On error tokenizer must release allocated memory.

Screenshots ✨

System information

Desktop πŸ’»:

  • OS: Windows 10
  • Browser None
  • Version latest

Smartphone πŸ“±:

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context 🌞

Add multi-character operators support

Feature request

Is your feature request related to a problem? Please describe.

Add multi-character operators support for Lexer.
Example:

  • <<
  • ==
  • !=
  • ...

Describe the solution you'd like 🌟

Token with type OPERATOR and wstring payload.

Describe alternatives you've considered 🐾

Analyzing several tokens in syntax analyzer.

Additional context πŸ‘:

Fix incorrect number reading

Describe the bug πŸ‘€

Incorrect number reading with Lexer in scientific notation.

How to reproduce πŸƒ:

  1. Try to assign number 20e+20 to the variable.
  2. Compile.
  3. See error.

Expected behavior πŸ™Œ

I expected that 20e+23 is a correct number notation, but Lexer interprets that like several lexemes.

Screenshots ✨

System information

Desktop πŸ’»:

  • OS: Windows
  • Browser None
  • Version latest

Smartphone πŸ“±:

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context 🌞

Add validation errors array

Feature request

Is your feature request related to a problem? Please describe.

Add validation errors array to allow compiler throw several errors per one compilation attempt.

Describe the solution you'd like 🌟

A vector of errors. After validation it's length must be checked. If this array has errors - then output them to stderr and throw exception.

Describe alternatives you've considered 🐾

Just one error per compilation.

Additional context πŸ‘:

Fix problem with incorrect arithmetic operations priority

Describe the bug πŸ‘€

Tokenizer interprets math expressions wrongly. It must apply operations by operators priority. We can use Reverse polish nonation (RPN) to interpret math expressions correctly.

How to reproduce πŸƒ:

  1. Try to build syntax tree for int test = 2 + 2 * 2 / 4;
  2. Get result tree:
└─[op2] VAR: DeclarationNode | INT | test
   └─[op1] DIVIDE: Node
       └─[op1] MULTIPLY: Node
           └─[op1] ADD: Node
               └─[op1] CONST: IntegerNode | 2
               └─[op2] CONST: IntegerNode | 2
           └─[op2] CONST: IntegerNode | 2
       └─[op2] CONST: IntegerNode | 4

Expected behavior πŸ™Œ

Expected syntax tree:

└─[op2] VAR: DeclarationNode | INT | test
   └─[op1] ADD: Node
       └─[op1] DIVIDE: Node
           └─[op1] MULTIPLY: Node
               └─[op1] CONST: IntegerNode | 2
               └─[op2] CONST: IntegerNode | 2
           └─[op2] CONST: IntegerNode | 4
       └─[op2] CONST: IntegerNode | 2

Screenshots ✨

System information

Desktop πŸ’»:

  • OS: Windows 10
  • Browser None
  • Version latest

Smartphone πŸ“±:

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context 🌞

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.