Results 1 to 5 of 5

Thread: The art of Lexical analysis and Abstract syntax tree building [including source]

  1. #1

    Thread Starter
    Member
    Join Date
    May 2012
    Posts
    57

    Smile The art of Lexical analysis and Abstract syntax tree building [including source]

    Long time ago Joacim Andersson showed me the way of parsing a script the right way,
    from that moment i was determined to create a simple yet powerfull engine for myself that
    i used in pretty much all my apps.

    Name:  2hcTVTx.jpg
Views: 1816
Size:  34.7 KB

    You could say i was a bit obessed with the idea of making your own syntax and be as robust as possible.
    I looked at various languages such as C#, Python, Lua and Ruby. In the end i wend with the combination of Ruby and c# style,
    the reason with Ruby was that it has this particulair concept of that everything is an object so things such as this are possible:
    Code:
    var = -10.abs()
    I really like that idea alote, and i took c# for its known syntax overall with most developers.
    It uses regex to parse its tokens and it does not have the execution code yet just the parsing.
    So you can cook your own if you want.

    Im sure it has some mistakes here and there or could be improved, im all ears to hear about it.



    - Greets Barret
    Attached Files Attached Files

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: The art of Lexical analysis and Abstract syntax tree building [including source]

    This should be in one of the CodeBank forums... it's not a question

    Edit: I've notified a moderator for you

  3. #3
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: The art of Lexical analysis and Abstract syntax tree building [including source]

    Interesting project be curious to have a good look tomorrow. Wish you would move away from the habit so many others use and learn the benefits of white space. This single line force style is horrible buddy.

  4. #4
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,900

    Re: The art of Lexical analysis and Abstract syntax tree building [including source]

    Good work.

    I've moved it to codebank because it'll slowly get lost in the main forum.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  5. #5

    Thread Starter
    Member
    Join Date
    May 2012
    Posts
    57

    Re: The art of Lexical analysis and Abstract syntax tree building [including source]

    @FunkyDexter and .paul.: Im sorry about that :O

    @Ident: Oh, well please show me whats better i'll be glad to improve my 'habbits'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width