grammar Questions

1

Solved

According to the documentation the default definition of the ws method in a grammar is to match zero or more whitespace characters, as long as that point is not within a word: regex ws { <!ww&g...
Elder asked 1/4, 2019 at 19:1

2

Solved

I am working on a merge tool for JavaScript programs, and I need to write a grammar for JavaScript (version >= ES6) in JavaCC format. For that, I want to use an openly available BNF grammar ...
Blastema asked 2/7, 2017 at 12:41

4

Solved

I am trying to build a DCG which recognizes all lists which match this form : a^n b^2m c^2m d^n. I have written up the following rules: s --> []. s --> ad. ad --> a, ad, d. ad --> bc. b...
Fugger asked 3/1, 2011 at 23:39

1

Solved

Consider the grammar: TOP ⩴ 'x' Y 'z' Y ⩴ 'y' Here's how to get the exact value ["TOP","x",["Y","y"],"z"] with various parsers (not written manually, but generated from the grammar): xyz__Parse...
Dresden asked 25/1, 2019 at 19:53

1

Solved

I'd like to add the simplest possible (mvp) language grammar and syntax highlighting to vscode. It's (imo) a mess of TextMate docs (two different versions apply) and random internet advice. I can'...

12

Solved

Apart from an architectural point of view, i'm wondering if there is any difference in .net between a readonly property and a function. Are properties only conceptual wrappers around functions? P...
Caveman asked 22/10, 2010 at 12:32

3

Solved

I have the code in: https://gist.github.com/ravbell/d94b37f1a346a1f73b5a827d9eaf7c92 use v6; #use Grammar::Tracer; grammar invoice { token ws { \h*}; token super-word {\S+}; token super-phra...
Rental asked 11/1, 2019 at 11:38

2

Solved

I'm trying to understand the four different Chomsky language types but the definitions that I have found don't really mean anything to me. I know type 0 is free grammar, type 1 is context sensitive...
Soukup asked 23/5, 2012 at 12:1

4

Solved

So I've been making a grammar in Eclipse with ANTLR v3.4 and I've made one that works and I want to make sure when I edit it everything still works. I can go into the interpretter everytime but tha...
Ainslee asked 31/5, 2012 at 17:5

2

Solved

I have been working through the Advent of Code problems in Perl6 this year and was attempting to use a grammar to parse the Day 3's input. Given input in this form: #1 @ 1,3: 4x4 and this grammar...
Nickey asked 10/12, 2018 at 18:12

2

Solved

In the Perl doc, there is a section about .postfix/.postcircumfix, it says that In most cases, a dot may be placed before a postfix or postcircumfix: my @a; @a[1, 2, 3]; @a.[1, 2, 3]; # Same ...
Competency asked 5/5, 2018 at 12:2

2

Solved

Possible duplicate for this question however for me it's not specific enough. The python grammar is claimed to be LL(1), but I've noticed some expressions in the Python grammar that really confuse...
Heterotaxis asked 3/12, 2018 at 15:14

1

Grammars are classes and, as such, they should get to be subject to the same rules as other classes. However, there seems to be a problem with exporting regexes from a Grammar: grammar Word { to...
Microtone asked 8/10, 2018 at 6:6

2

Solved

I have an ANTLR 4 grammar: grammar Test; start : NonZeroDigit '.' Digit Digit? EOF ; DOT : '.' ; PLUS : '+' ; MINUS : '-' ; COLON : ':' ; COMMA : ',' ; QUOTE : '\"' ; EQUALS : '=' ; SEMICOLON ...
Evangelical asked 26/1, 2014 at 21:39

2

Solved

How do you build an AST (Abstract Syntax Tree) for left-associative operators using PEG.js? I've tried to write some code based on the information I found on the internet, but I seem to have made ...
Gerdy asked 12/6, 2014 at 0:22

1

Solved

Last week I decided to give a try to Perl6 and started to reimplement one of my program. I have to say, Perl6 is so the easy for object programming, an aspect very painfull to me in Perl5. My pr...
Claytor asked 24/8, 2018 at 13:3

1

Solved

I am studying a little about the source code of Python and I decided to put into practice some changes in the grammar, so I downloaded the source code of version 3.7. I am following the guidelines...
Trina asked 17/8, 2018 at 19:18

6

Solved

I was reading about parsers and parser generators and found this statement in wikipedia's LR parsing -page: Many programming languages can be parsed using some variation of an LR parser. One not...
Lyford asked 28/10, 2008 at 13:49

2

Solved

I am still learning perl6, and I am reading the example on grammar from this page: http://examples.perl6.org/categories/parsers/SimpleStrings.html ; I have read the documentations on regex multiple...
Tile asked 18/7, 2018 at 17:47

5

Solved

How do you identify whether a grammar is LL(1), LR(0), or SLR(1)? Can anyone please explain it using this example, or any other example? X → Yz | a Y → bZ | ε Z → ε
Scorpaenid asked 13/12, 2011 at 21:47

1

Solved

I am parsing a file with a format that can include: INT32 price min 10 max 100 alertIfSold ; The min, max and alertIfSold tokens are all optional and can appear in any order. That is INT32 pr...
Lintel asked 5/6, 2018 at 2:29

2

Solved

While reading the Xml grammar for perl6 (https://github.com/supernovus/exemel/blob/master/lib/XML/Grammar.pm6), I am having some difficulties understanding the following token. token pident { &lt...
Snub asked 4/6, 2018 at 8:8

3

Solved

As indicated in this issue, some token names clash with method names in the class hierarchy of Grammar (which includes Match, Capture, Cool, Any and obviously My.). For instance, `Mu.item grammar ...
Balboa asked 26/5, 2018 at 17:48

2

Solved

GCC and Clang disagree on whether template<typename>; is a valid statement in C++ at global scope. I'd expect it not to be allowed in the C++ standard because templatization pertains to decl...
Paramaribo asked 20/5, 2018 at 10:28

2

Solved

I need an algorithm to computing FIRST and FOLLOW sets for a grammar. Is there a simple algorithm or simple code for computing these?
Simoniac asked 8/11, 2013 at 21:51

© 2022 - 2024 — McMap. All rights reserved.