grammar Questions
2
I have this action which overrides an action in another action class:
method taskwiki-prefix($/ is copy) {
my $prefix = $/.Str;
$prefix ~~ s:g!'|'!!;
make $prefix;
}
The substitution throws t...
2
Solved
I have this method in a class that's throwing a Cannot bind attributes in a Nil type object. Did you forget a '.new'?
method parse() {
grammar FindHeaders {
token TOP { [<not-header> | <...
2
Solved
This code parses $string as I'd like:
#! /usr/bin/env raku
my $string = q:to/END/;
aaa bbb # this has trailing spaces which I want to keep
kjkjsdf
kjkdsf
END
grammar Markdown {
token TOP { ^ (...
5
Solved
"I was doing the follow exercise:
A gymnast can earn a score between 1 and 10 from each judge.
Print out a series of sentences, "A judge can give a gymnast _ points."
Don't worry if ...
2
Solved
I'm trying to parse a comma separated list. To simplify, I'm just using digits. These expressions would be valid:
(1, 4, 3)
()
(4)
I can think of two ways to do this and I'm wondering why exact...
Gisela asked 12/6, 2019 at 2:10
1
Solved
At many places (for example in this answer here), I have seen it is written that an LR(0) grammar cannot contain ε productions.
Also in Wikipedia I have seen statements like: An ε free LL(1) gramma...
Pajamas asked 16/1, 2022 at 14:50
1
Solved
I'm parsing a language that doesn't have statement terminators like ;. Expressions are defined as the longest sequence of tokens, so 5-5 has to be parsed as a subtraction, not as two statements (li...
Sanyu asked 3/1, 2022 at 20:56
6
Solved
I was trying a tiny code with if statement, although it is very simple,but there is something I really confused here is the code
n<-857
while(n!=1){
if(n<=0)
print("please input a positive ...
Amado asked 23/3, 2013 at 12:5
3
Solved
9
Solved
What is the actual difference between LR, SLR, and LALR parsers? I know that SLR and LALR are types of LR parsers, but what is the actual difference as far as their parsing tables are concerned?
A...
Collen asked 20/4, 2010 at 14:55
2
Solved
According to the ECMAScript spec:
There are several situations where the identification of lexical input
elements is sensitive to the syntactic grammar context that is
consuming the input elements...
Applicable asked 16/11, 2021 at 2:25
2
Solved
I am reading Rebol Wikipedia page.
"Parse expressions are written in the parse dialect, which, like the do dialect, is an expression-oriented sublanguage of the data exchange dialect. Unlike ...
Rase asked 12/9, 2019 at 14:13
1
Remove the ambiguity from the following grammar
S −−> if E then S
| if E then S else S
| other
Versed asked 13/9, 2021 at 18:27
1
Solved
I am using The Java® Language Specification Java SE 8 Edition as a reference.
Example class:
class MyClass {
void method() {
new int[] {0}[0] = 1;
}
}
The code new int[] {0}[0] = 1 should be ...
Twandatwang asked 6/10, 2021 at 17:6
2
Relevant chunk of Irony grammar:
var VARIABLE = new RegexBasedTerminal("variable", @"(?-i)\$?\w+");
variable.Rule = VARIABLE;
tag_blk.Rule = html_tag_kw + attr_args_opt + block...
Tapdance asked 11/4, 2011 at 1:58
8
Solved
I need to write a python script that removes every word in a text file with non alphabetical characters, in order to test Zipf's law.
For example:
[email protected] said: I've taken 2 reports...
Illuminative asked 29/9, 2017 at 9:44
6
Solved
I want to come up with a language syntax. I have read a bit about these three, and can't really see anything that one can do that another can't. Is there any reason to use one over another? Or is i...
5
I've heard if you parse something LL(1) it's faster so I was wondering if you want to parse a JSON string can this be done by using a LL(1) parser
1
I know that a declaration like
int* a[5];
declares a as an array of 5 pointers to int. But how do I deduce this, just by using the C++ Standard?
Holub asked 25/4, 2021 at 20:29
1
Solved
This might be related to me not understanding the Keyword Extraction feature, which from the docs seems to be about avoiding an issue where no space exists between a keyword and the following expre...
Garnetgarnett asked 21/3, 2021 at 14:36
2
I want to process the whole Tanach file, in Hebrew. For that, I chose the language Raku because some of its features (grammar and unicode support).
So, I defined some tokens to select the relevant ...
3
I'm using ANTLR4 to create a parse tree for my grammar, what I want to do is modify certain nodes in the tree. This will include removing certain nodes and inserting new ones. The purpose behind th...
4
Solved
why do we convert the grammar to chomsky normal form ? Is there a advantage ?
Plenipotent asked 3/2, 2011 at 8:19
2
Solved
Given an NLP parse tree like
(ROOT (S (NP (PRP You)) (VP (MD could) (VP (VB say) (SBAR (IN that) (S (NP (PRP they)) (ADVP (RB regularly)) (VP (VB catch) (NP (NP (DT a) (NN shower)) (, ,) (SBAR (W...
Billhook asked 4/9, 2016 at 18:10
2
Is there a way to get Perl 6 to generate an error message if a grammar does not match? Or at least return the position of the last data it processed? It is quite hard to fix syntax errors if all I ...
© 2022 - 2024 — McMap. All rights reserved.