ManiaScript Language Parser (experimental)

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
tonechild
Posts: 12
Joined: 20 Mar 2017, 12:43

ManiaScript Language Parser (experimental)

Post by tonechild »

Hi all,

I've spent the past few days working almost around the clock on a language parser for ManiaScript. The first phase has been completed and is available for public review.

https://github.com/MattMcFarland/maniascript-parser

If you have node installed, you can use this to parse your doc.h file and create an AST(Abstract Syntax Tree) of the language structure.

The next phase will be to create a transform for the AST that turns it into a very basic and generic AST so it can be used for code inspection tools (like intellisense)

In tandem, we can use the AST to also bootstrap yet another parser :P that can be used to build Script.txt files - which is the ultimate goal but we're not there yet!

The build took that entire doc.h file and created 16,000 lines of code, all creating a very detailed and machine readable JSON file that describes ManiaScript!!!

This was super challenging but super fun ;)

You can see the generated AST here (be warned its huge file): https://github.com/MattMcFarland/manias ... t/ast.json

You can see the generated tokens here (which are used to create the AST): https://github.com/MattMcFarland/manias ... okens.json

Or you can build your own! :)

:pil :pil :pil
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest