I'm using ANTLR4 and trying to generate a parse tree for a python file I have. I used the grammar file python3.g4 from the ANTLR4 documentation. I hav ...
I'm using ANTLR4 and trying to generate a parse tree for a python file I have. I used the grammar file python3.g4 from the ANTLR4 documentation. I hav ...
. Answers to this question are eligible for a +500 reputation bounty. t ...
Parser does not see equality expression: extraneous input '=' expecting {<EOF>, '~', '(', OPERATOR, IDENTIFIER, NUMBER, STRING} Even error is n ...
The regex [a-zA-Z-]+:: matches strings like one-name::. I would like a regex that will do the opposite. Is there an "automated" way to build such a r ...
I'm a novice programmer and I suspect this code is terrible. Can someone offer suggestions or code this in a better way? I'm trying to generate text i ...
I've seen this question asked multiple times, and also seen people "solve" it... but it either confused me or didn't solve my specific situation: Her ...
I am trying to build a top left parser in prolog for the sentence "The little pigs were safe inside" and I am trying to figure out where I went wrong ...
I've seen various proofs on proving that a language is not regular by the pumping lemma, such as something like: 0^n1^n However, I've only seen ...
. Answers to this question are eligible for a +400 reputation bounty. D ...
I have the following fragment in my Bison file that describes a simple "while" loop as a condition followed by a sequence of statements. The list of s ...
I tried to group together two cases to reduce code duplication in the grammar: From to But that caused a build error in what I was sure is a si ...
Consider the following state diagram which accepts the alphabet {0,1} and accepts if the input string has two consecutive 0's or 1's: 01001 --> ...
What is the terminology that is used to differentiate the difference between the accepting token and the tokens that are matched in the stream? As an ...
On the Wikipedia page of Finite State Machines it shows a graphic of the automata types: I've never heard of combinational logic being included in ...
Does anybody know of a project that uses Emacs-Lisp or Common-Lisp to formally encode grammars of programming languages? My special requirement is tha ...
What does the following mean in the JSON rfc? I assume 1*DIGIT means "One or more digits", but why that particular notation, why not as \d+ or DIGI ...
I need help defining some rules for a grammar in cups. The rules in question belong to the declaration block, which consists of the declaration of 0 o ...
This is similar to this question for classes, except the same procedure does not seem to work for Grammars. This returns: This seems to point to ...
How to construct unrestricted grammar that generates L = {a^ib^j c^k^d^l : i not equal to k AND j not equal to l}. a is to the power of i, 'b' raised ...
Some databases support using literal NULL as an operand while others do not. As an example: Snowflake: null BigQuery: error MySQL: null Postgres ...