Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse tree and grammar information

Does anyone know where to find good online resources with examples of how to make grammars and parse trees? Preferably introductory materials. Info that is n00b friendly, haven't found anything good with Google myself.

Edit: I'm thinking about theory, not a specific parser software.

like image 908
fuzzylogikk Avatar asked Sep 17 '08 13:09

fuzzylogikk


People also ask

What is parse tree in grammar?

A parse tree or parsing tree or derivation tree or concrete syntax tree is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar.

Why is parse tree important?

Parse trees are an in-memory representation of the input with a structure that conforms to the grammar. The advantages of using parse trees instead of semantic actions: You can make multiple passes over the data without having to re-parse the input. You can perform transformations on the tree.

What are the properties of a parse tree?

Properties Of Parse Tree- Root node of a parse tree is the start symbol of the grammar. Each leaf node of a parse tree represents a terminal symbol. Each interior node of a parse tree represents a non-terminal symbol. Parse tree is independent of the order in which the productions are used during derivations.


3 Answers

Not online, but maybe you should take a look at Compilers: Principles, Techniques, and Tools (2nd Edition) by Aho et al. This is a standard text that has been evolving for 30 years (if you count the 1st Dragon Book, published in 1977

like image 120
Seb Rose Avatar answered Oct 04 '22 14:10

Seb Rose


Well, here's where I learned it...

http://www.cs.uiuc.edu/class/sp08/cs273/

Click on the lectures tag, scroll through till you find the lectures on the material you are talking about.

Love my alma mater. God bless them, they never take down their lectures in any class and you can go and read any of them anytime you want.

edit: Looks like you want lecture11

like image 43
Aaron Avatar answered Oct 04 '22 14:10

Aaron


Antlr?

http://www.antlr.org/

Has a quite good IDE for designing a grammar, and a lot of generators for different languages.

like image 33
Grad van Horck Avatar answered Oct 04 '22 15:10

Grad van Horck