Skip to main content
-7 votes
0 answers
27 views

I am trying to solve past year exam papers for Compilers and i am stuck with this question please help me Z → d | XY Z Y → c | ϵ X → Y | a like I am getting confused , its. a loop there and i cant ...
Abhinav's user avatar
-1 votes
1 answer
55 views

I am trying to parse code into AST. I want to keep minimum keywords and delimiters in the AST while keeping the semantics. In Python function definition def foo():, the last : is syntactically ...
MR_Xhao's user avatar
  • 11
5 votes
1 answer
136 views

Since we have no parentheses () in rust if and while conditions, there may be some ambiguous situations, e.g. while 0 > n {} {} is either parsed to be while (0 > n) {} and {} (2 statements), or ...
Mike Li's user avatar
  • 81
0 votes
0 answers
78 views

Having trouble understanding the ambiguity reported by Antlr4 (4.7.1): grammar Temp; start: expr; expr: IDENTIFIER '(' expr (',' expr)* ')' // function call | expr '.' slice2 ...
Slayer's user avatar
  • 111
0 votes
0 answers
80 views

I am trying to implement a parser for first-order logic formulas in Rust using pest (which seems to be the reference in Rust). Apparently, this library is not based on context-free grammars but on ...
Weier's user avatar
  • 1,439
0 votes
0 answers
329 views

I have individual verbs in a collection of String objects (thanks to How to find whether a word is a noun or a verb using Stanford parser?). Now for each, I would like to obtain the appropriate noun ...
velw's user avatar
  • 221
1 vote
0 answers
67 views

In the "Compiler Design in C" book, below is a table on a simple expression grammar. According to the below excerpts: Note that the grammar is recursive. For example, Production 2 has ...
yapkm01's user avatar
  • 3,811
3 votes
1 answer
98 views

Below code tokenises the text and identifies the grammar of each tokenised word. import nltk from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import wordnet as wn #nltk....
Ali's user avatar
  • 31
2 votes
1 answer
78 views

I wrote this grammar to describe a simple patch procedure we use at work, operating on source code files. Engineers check in files of the form: {ignored space} //find_start {possible comment or ...
Ryan Brothers's user avatar
0 votes
1 answer
81 views

how to remove this warning : warning(180): AlgoGrammar.g4:54:13: chars a-z used multiple times in set [A-Za-z_] warning(180): AlgoGrammar.g4:54:23: chars a-z used multiple times in set [A-Za-z0-9_] ...
elhinchi ammar's user avatar
1 vote
1 answer
109 views

I saw an article about the Result pattern on the official flutter site(https://docs.flutter.dev/app-architecture/design-patterns/result), and I thought it was a good structure, so I tried to apply it ...
asci's user avatar
  • 11
3 votes
1 answer
103 views

Below are two grammars. In this grammar, semantic predicates do "work". I.e. if they are false, rules don't match and if they are true, rules do match: expr : term | expr asterisk ...
Dims's user avatar
  • 51.8k
0 votes
0 answers
31 views

Is the following good grammar for Nearley.js? It describes logical expressions with variables, negation, conjunction and parentheses. It's a bit convoluted (?), but I didn't know other way how to make ...
zaa's user avatar
  • 113
1 vote
1 answer
56 views

I have a problem with a [relatively simple] grammar, a distilled version of a much bigger grammar. Bison reports one shift/reduce conflict, which is resolved incorrectly: the resulting parser fails to ...
DYZ's user avatar
  • 57.3k
5 votes
3 answers
152 views

I want to write a Raku grammar to check a monthly report about work contribution factors, written in Racket/Scribble. The report is divided, at the highest level, into monthly sections, and beneath ...
sailortailorson's user avatar

15 30 50 per page
1
2 3 4 5
221