Now we also need definition of “regular grammar”
Regular Grammars:
Regular grammars describe exactly all regular languages and are in that sense equivalent to finite state automata and regular expressions. Moreover, the right regular grammars by themselves are also equivalent to the regular languages, as are the left regular grammars.
Every regular grammar is a context-free grammar. Every context-free grammar can be easily rewritten into a form in which only a combination of left regular and right regular rules is used. Therefore, such grammars can express all context-free languages. Regular grammars, which use either left-regular or right-regular rules but not both, can only express a smaller set of languages, called the regular languages. In that sense they are equivalent with finite state automata and regular expressions.
What is a regular language? It is important to understand “regular language” for better understanding of above definitions. We will discuss it in our next post..
Showing posts with label formal grammar. Show all posts
Showing posts with label formal grammar. Show all posts
Monday, April 30, 2007
Wednesday, April 25, 2007
Automata Step by Step
This post is connected to the previous post. So if you have not read that post, please give few minutes in reading that post.
Parsing:
Parsing (more formally syntax analysis) is the process of analyzing a sequence of tokens to determine its grammatical structure with respect to a given formal grammar. A parser is the component of a compiler that carries out this task.
Parsing transforms input text into a data structure, usually a tree, which is suitable for later processing and which captures the implied hierarchy of the input. Lexical analysis creates tokens from a sequence of input characters and it is these tokens that are processed by a parser to build a data structure such as parse tree or abstract syntax trees.
Can you guess what the next question is? Yes, you are right. Next question is what the Formal Grammar is.
Parsing:
Parsing (more formally syntax analysis) is the process of analyzing a sequence of tokens to determine its grammatical structure with respect to a given formal grammar. A parser is the component of a compiler that carries out this task.
Parsing transforms input text into a data structure, usually a tree, which is suitable for later processing and which captures the implied hierarchy of the input. Lexical analysis creates tokens from a sequence of input characters and it is these tokens that are processed by a parser to build a data structure such as parse tree or abstract syntax trees.
Can you guess what the next question is? Yes, you are right. Next question is what the Formal Grammar is.
Labels:
formal grammar,
grammar,
lexical analysis,
parse tree,
parser,
parsing,
sequence,
syntax,
tokens,
tree
Subscribe to:
Comments (Atom)