Java Glossary : grammar

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : G words : grammar.

grammar
Computer languages have very strict and fragile grammars. Grammars can be classified by how easy it is to mechanically analyse, that is parse, them. Analysis is usually broken into two phases, breaking the character stream into tokens calling lexing (or scanning), and analysing the relationship of the tokens, called parsing. The lexing part is quite simple, a finite state automaton that flips states when it sees certain character strings, as it processes the input a character at a time, and collects the input into tokens. The parser is a pattern matcher, that looks for legal patterns in the language. It may have to try a great many possible patterns called production rules in the process of analysing. The advantages of top down parsers include:
book_coverCompilers : Principles, Techniques, and Tools
0-201-10088-6
Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman
The classic text to learn about grammars and compiler construction is The Dragon Book.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 1140.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/grammar.html J:\mindprod\jgloss\grammar.html