Coco / R
Coco / R | |
---|---|
Basic data
|
|
Maintainer | Institute for System Software, Johannes Kepler University Linz |
category | Parser generator |
License | GNU GPL |
http://ssw.jku.at/Coco/ |
Coco / R is a parser generator that generates a scanner and a parser for this language from an L-attributed EBNF grammar of a source language.
The scanner works as a finite automaton . It supports Unicode characters in UTF-8 encoding and can be configured to be case-insensitive. The recognition of symbols can be made dependent on their right context. In addition to terminal symbols, the scanner can also process pragmas ; H. Symbols that do not belong to the syntax of the language, but can appear anywhere in the input stream (e.g. compiler directives or line end characters).
The parser works according to the method of recursive descent . LL (1) conflicts can be resolved by anticipating several symbols or by semantic checks. Thus the class of accepted grammars is LL (k) for any k. Fuzzy parsing can be achieved using an ANY symbol that describes complementary sets of symbols. Semantic actions are described in the language of the generated scanner and parser. Error handling in the generated parser can be refined by specifying synchronization points and "weak terminal symbols". The grammar is also checked for completeness, consistency, freedom from redundancy and its LL (1) property.
There are versions of Coco / R for most modern languages ( Java , C # , C ++ , Pascal , Modula-2 , Delphi , VB.NET , Python , Ruby, and others). An Eclipse plug-in is available for the Java version . Grammars for C # and Java are available for download.
Coco / R was developed at the University of Linz and is under a variant of the GNU General Public License .
See also
literature
- Pat Terry: Compiling with C # and Java . Pearson, 2005, ISBN 978-0-321-26360-5 . - Uses Coco / R in compiler construction. In English.
- Peter Rechenberg , Hanspeter Mössenböck : A compiler generator for microcomputers . Hanser, 1985, ISBN 3-446-14495-1 . - The book describes the construction of Coco in Modula-2.