antlr / antlr/antlr3

JavaScript target is broken in the latest (v3.5) release

Open
#111 10 comments 0 reactions 0 assignees View on GitHub
target:javascript
Dominant language
Java
Stars
253
Forks
178
PR merge metrics
No merged PRs in 30d

Description

If you try to compile any grammar for tests directory, say `t001lexer.g`

```
lexer grammar t001lexer;
options {
language = JavaScript;
}

ZERO: '0';
```

you'll get a bunch of errors including:

```
error(24): template error: JavaScript.stg 27:6: required parameters (filterMode) must appear before optional parameters
```

Which is expected because of

```
lexer(grammar, name, tokens, scopes, rules, numRules, labelType="Token",
filterMode, superClass="org.antlr.runtime.Lexer") ::= <<
```

in `JavaScript.stg`

Reproducible in linux and windows using `OpenJDK v 1.6.0_20` and `JRE 1.7.0_21` correspondingly

The actual result: nothing is generated

The expected result: the `.js` and `.tokens` files to be generated

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with tests/t001lexer.g and inspect JavaScript.stg, especially the lexer template around line 27. Run the grammar compilation and confirm that the fix produces both the .js and .tokens files without template errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.