PBug90 / jassjs

A native JavaScript parser for the WarCraft 3 world editor scripting language: JASS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JASS Parser

This is a work in progress basic implementation of a Warcraft 3 vanilla JASS Parser in JavaScript. It uses the chevrotain library and a custom grammar to parse the input and outputs an abstract syntax tree that can be traversed.

Use cases

Aside from the general use case of checking for correct syntax and semantic in a jass program, you can use this to extract information from WarCraft 3 melee maps aswell. Check the examples/mapexample.js file to show a use case for extracting neutral unit metadata from a Melee map jass file.

Usage

Due to the WIP status, no usage instructions yet. Feel free to try it out though.

Todos

  • loop statements
  • local variable declarations
  • function arguments
  • function return values
  • verify correct operator precedence in grammar
  • Array access
  • ... and a lot more :)

Feature Requests

Feel free to open a PR for new features or improvements.

About

A native JavaScript parser for the WarCraft 3 world editor scripting language: JASS.

License:MIT License


Languages

Language:Objective-J 65.6%Language:JavaScript 34.4%