context-free-grammar
chomsky hierarchy and programming languages
I\'m trying to learn some aspects of the Chomsky Hierar开发者_如何转开发chy which are related to programming languages, and i still have to read the Dragon Book.[详细]
2023-01-01 04:18 分类:问答Is there a standard C++ grammar?
Does the standard specify the official C++ grammar? I searched, but did not find it anywhere. Also, I wish to read a bit about C++ grammar in detail, like which category of grammars it falls in, etc[详细]
2022-12-30 07:58 分类:问答How do you classify languages into regular, context free, and phrase-structure?
If you\'re given a language, how do you figure out if it\'开发者_如何学Cs regular, CF but not regular, or phrase-structure but not CF? Is there a good way to attack this problem? I could randomly try[详细]
2022-12-30 01:05 分类:问答Context free grammar?
I have this problem where I need to convert the following CFG to CFG in CNF. S-> ABa A-> aab B-> Ac[详细]
2022-12-27 06:23 分类:问答Theory of computation - Using the pumping lemma for context free languages
I\'m reviewing my notes for my course on theory of computation and I\'m having trouble understanding how to complete a certain proof.Here is the question:[详细]
2022-12-26 16:58 分类:问答Shift-reduce: when to stop reducing?
I\'m trying to learn about shift-reduce parsing.Suppose we开发者_Go百科 have the following grammar, using recursive rules that enforce order of operations, inspired by the ANSI C Yacc grammar:[详细]
2022-12-26 08:59 分类:问答Why does ANTLR not parse the entire input?
I am quite new to ANTLR, so this is likely a simple question. I have defined a simple grammar which is supposed to include arithmetic expressions with numbers and identifiers (strings that start with[详细]
2022-12-25 22:13 分类:问答Java: how to tell if a line in a text file was supposed to be blank?
I\'m working on a project in which I have to read in a Grammar file (breaking it up into my data structure), with the goal of being able to generate a random \"DearJohnLetter\".[详细]
2022-12-22 13:16 分类:问答How to define a grammar for a programming language
How to define a grammar (context-free) for a new programming language (imperative programmin开发者_StackOverflowg language) that you want to design from scratch.[详细]
2022-12-20 20:58 分类:问答What is a good tool for automatically calculating FIRST and FOLLOW sets?
I\'m currently in the middle of playing with a BNF grammar that I hope to be able to wrangle into a LL(1) form. However, I\'ve just finished making changes and calculating the new FIRST and FOLLOW set[详细]
2022-12-20 15:37 分类:问答