Coco/R

Coco / R is a parser generator which generates an L - attributed EBNF grammar of a source language a scanner and a parser for this language.

The scanner works as a finite state machine. It supports Unicode characters in UTF -8 encoding, and can be configured so that case is ignored. The recognition of symbols can be made dependent on their right context. In addition to terminal symbols, the scanner handle pragmas, ie Symbols that do not belong to the syntax of the language, but can occur anywhere in the input stream (eg, compiler directives or newline characters ).

The parser operates according to the method of recursive descent. LL (1) conflicts can be solved by anticipation by several symbols, or by semantic checks. Thus the class of accepted grammars LL ( k) for any k fuzzy parsing can be achieved by an ANY symbol that describes complementary symbol sets. Semantic actions are described in the language of the generated scanner and parser. The 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, redundancy and freedom to their 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). For the Java version exists an Eclipse plugin. 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.

195501
de