This project has moved and is read-only. For the latest updates, please go here.

Using parser out of box

Feb 25, 2014 at 7:56 PM
currently i'm working on project that required some scripting functionally, i find out jurassic really helpful, thanks the author, at now i have an issue with code editor, i want to add intellisense to the editor for better code complete, so i need to be able to parse source code to get objects, variables and etc. is it possible to use some part of parser code of jurassic to do that?
Feb 26, 2014 at 2:26 AM
Jurassic is very much a standard compiler, which means it:
  1. Tokenizes the input text.
  2. Parses the token stream into an abstract syntax tree (AST).
  3. Uses the AST to generate code.
With some work, you can absolutely rip out the tokenizer and/or the parser. However, be aware there is no provision for handling broken and/or incomplete code, something which is absolutely necessary for a code editor (the parser is likely to be more problematic than the tokenizer).