Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract dims token in correct way #8

Open
sabaka opened this issue Feb 8, 2016 · 1 comment
Open

Extract dims token in correct way #8

sabaka opened this issue Feb 8, 2016 · 1 comment
Assignees

Comments

@sabaka
Copy link
Owner

sabaka commented Feb 8, 2016

I've tried to extract it like

dims!
    :   (options{greedy=true; }:
            ({LA(1) == AT}? annotations
            | )
                lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK
        )+
    ;

screen shot 2016-02-08 at 23 15 43

and

dims
    :   (options{greedy=true; }:
            ({LA(1) == AT}? annotations
            | )
                lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK
        )+
    ;

screen shot 2016-02-08 at 23 18 23

but I face problem with tree structure: array declaration is not included into typespec or missed completely. I suppose it should be fixed with custom parsing structure like we use for TYPE and for lots of rules

Expected:
screen shot 2016-02-08 at 23 11 28

@sabaka sabaka self-assigned this Feb 8, 2016
@sabaka
Copy link
Owner Author

sabaka commented Feb 8, 2016

It can also be possible to use declaratorBrakets instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant