- Coco/R
Infobox Software
name = Coco/R
caption =
author = Hanspeter Mössenböck and others
developer =
released =
latest_release_version =
latest_release_date =
programming_language =
operating system =
platform =Cross-platform
language =
status =
genre = parser/scanner generator
license =GNU GPL
website = [http://ssw.jku.at/Coco/ Coco/R home]Coco/R is a
compiler generator that takes an L-attributedEBNF grammar of a source language and generates a scanner and a parser for that language.The scanner works as a
deterministic finite state machine . It supportsUnicode characters inUTF-8 encoding and can be made case-sensitive or case-insensitive. It can also recognize tokens based on their right-hand-side context. In addition to terminal symbols the scanner can also recognize pragmas, which are tokens that are not part of the syntax but can occur anywhere in the input stream (e.g. compiler directives or end-of-line characters).The
parser usesrecursive descent ; LL(1) conflicts can be resolved by either a multi-symbol lookahead or by semantic checks. Thus the class of accepted grammars is LL(k) for an arbitrary k. Fuzzy parsing is supported by so-called ANY symbols that match complementary sets of tokens. Semantic actions are written in the same language as the generated scanner and parser. The parser's error handling can be tuned by specifying synchronization points and "weak symbols" in the grammar. Coco/R checks the grammar for completeness, consistency, non-redundancy as well as for LL(1) conflicts.There are versions of Coco/R for most modern languages (Java, C#, C++, Pascal,
Modula-2 ,Modula-3 , Delphi,VB.NET , Python, Ruby and others). The latest versions from theUniversity of Linz are those for C#, Java and C++. For the Java version there is an Eclipse plug-in. There are also sample grammars for Java and C#.Coco/R was originally developed at the University of Linz and is distributed under the terms of a slightly relaxed
GNU General Public License .ee also
*
ANTLR
*JavaCC
*SableCC References
Pat Terry: Compiling with C# and Java Pearson, 2005 - a book about using Coco/R for compiler construction.
External links
* [http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/ Coco/R homepage]
* [http://www.scifac.ru.ac.za/coco/ Coco/R page of Pat Terry]
* [http://www.ssw.uni-linz.ac.at/Coco/Doc/UserManual.pdf Coco/R user manual]
* [http://www.ssw.uni-linz.ac.at/Coco/Tutorial/ Coco/R tutorial slides (by Hanspeter Mössenböck)]
Wikimedia Foundation. 2010.