nevadascout / dash-core

The ultimate SQF development environment for Bohemia Interactive's ArmA series
http://dash.nevadascout.com
GNU General Public License v3.0
18 stars 10 forks source link

SQF Lexer/Parser #36

Open nevadascout opened 9 years ago

nevadascout commented 9 years ago

A proper lexer/parser for SQF will allow many things including:

Also:

JonBons commented 9 years ago

Just as a note. This has been done by Mac's Squint editor (https://sites.google.com/site/macsarmatools/squint) before and you may be able to ask him via email or BI Forum for any tips. I wrote a lazy wrapper around his DLLs that formatted the output into something that the SublimeLinter plugin can read. https://github.com/JonBons/sqfc

JonBons commented 9 years ago

If you do end up getting this done it would be awesome if you could make it separated (another project or nuget package) from this editor so that other tools can utilize the functionality. The problem I had with utilizing Squint's dlls is it thought about things differently and more specific to that editor so I never figured out how to get it's returned column number to match up with the way SublimeLinter thought about columns.

nevadascout commented 9 years ago

Cheers for that, I've had a look at Mac's code before - plus another SQF parser someone else had written (I forget who, I'm afraid), and decided to start over with a new, clean class library.

I first actually considered writing a fully-featured SQF plugin to use the power of Visual Studio, but that realm is just so complicated it was actually easier to start from scratch!

But yeah, the lexer/parser is already underway, however won't be ready for at least a few weeks. It's being written as a separate class library so I could certainly put it on nuget and on github as a separate repository.

Dash will use the the parser combined with a "projects" system to build up a syntax tree - -a "Code Object Model" -- that it can use with the ArmaSense code-completion, as well as syntax/error checking.

ArmaSense, combined with the parser will (hopefully) rival the power of Visual Studio's Intellisense and be able to suggest variables that are in scope from any file in the project, not just the current file as it does currently. It'll also allow it to only suggest variables that are properly in scope - so declaring a variable inside a loop when trying to call it outside won't result in a suggestion from ArmaSense.

JonBons commented 9 years ago

Awesome! Glad to hear that!

You seem to be on the ball with this, good luck!

nevadascout commented 9 years ago

Thanks man! I'll do my damned best :)