Giter Site home page Giter Site logo

compiler's Introduction

Welcome to my github profile

My name is Marco and i'm a computer engeneering student.
Right now i'm learning web programming, like JS and its main frameworks, Node.js and others.
I also like mobile programming with Kotlin to Android.

EstatísticasdoGitHubdeAnurag

Other medias that i use

Linkedin Badge Instagram Badge Outlook Badge

compiler's People

Contributors

tomascartman avatar

Watchers

 avatar  avatar

compiler's Issues

Error states in some automantons may be necessary

Some automatons can just ignore when the lexeme do not fit on them, but others they (probably) must declare an error, for now i have notice that AutomatonNumbers and AutomatonLogicalOperators should put an error.

AutomatonNumbers when it finish the lexeme with a 'dot', without a number at the end, or when it starts with a 'dot'.
AutomatonLogicalOperators when it get only one '&' or '|' symbol.

I don't know if this error should be task of the Lexer, whom has the next char or somehow the automatons should be responsible for this job. Maybe the lexer reporting an error after 'n' lookaheadChar gets trying the new lexeme will handle this problem

Problem to valid token "!="

In the diagram, after the state zero, all the other states are already valid states without a second char, excpet state two, which is represented by "!", it needs to be followed by a "=" like "!=" to be a valid token. it must be decided if the lexer.kt will reset the automaton or the automaton itself will do this job, and so implements and use the operator lookahead to test if after a "invalid" char "!" we can get a valid token "!=" by looking the following char.

Escape characters in input file

When the input file is read, the caracters that should be of escape like '"' or '\n' are put on the list of strings (sourceCode) like '' and '"', this is a problem to some automatons, in specific the AutomatonString that handles the char '"'.
Because it's already in the list of strings, it will be read once char at time, and treated like that, needing a special tratament at the automatons that should handle those escape chars.

Problem with three or more relational operators in sequence

There is no problem when two operator are in sequence, like "==" or ">=", but the linguage do not allows three operator in sequence, like "===", this should be a error, in the current code this would be treat like "==" first and then "=", generating two tokens.

The file to read must not have blank lines

After reading the file, trying to use the function nextChar() to access the list one char at time, blank lines in the file causes a java.lang.StringIndexOutOfBoundsException

Refractor automatons code and lexer code

The automatons should have a function to return a token when asked if it is in a valid state to generate the token. This will remove a lot of "if" code from the lexer, which should not be doing these tests.

A Token class should be created.

Create tests

Create tests to verify if the code is doing what it should be doing without a human (and human mistakes).

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.