YACC: Difference between revisions

From Lojban
Jump to navigation Jump to search
mNo edit summary
m (Text replace - "jbocre: c" to "c")
Line 2: Line 2:
YACC, an acronym for "Yet Another Compiler Compiler", is the name of a program which takes the description of a [[jbocre: LALR|LALR]](1) grammar and generates C code able to parse this grammar as output, written a long time ago (1974-75) for [[jbocre: UNIX|UNIX]] systems.
YACC, an acronym for "Yet Another Compiler Compiler", is the name of a program which takes the description of a [[jbocre: LALR|LALR]](1) grammar and generates C code able to parse this grammar as output, written a long time ago (1974-75) for [[jbocre: UNIX|UNIX]] systems.


The name itself comes from the fact that such a program is often used when developing a [[jbocre: compiler|compiler]] (language translation program, usually programming language to computer bytecode/assembly), while being a compiler itself.
The name itself comes from the fact that such a program is often used when developing a [[compiler|compiler]] (language translation program, usually programming language to computer bytecode/assembly), while being a compiler itself.


Today several YACC-style programs do exist, of which bison is probably the most well-known.
Today several YACC-style programs do exist, of which bison is probably the most well-known.

Revision as of 12:05, 23 March 2014

YACC, an acronym for "Yet Another Compiler Compiler", is the name of a program which takes the description of a LALR(1) grammar and generates C code able to parse this grammar as output, written a long time ago (1974-75) for UNIX systems.

The name itself comes from the fact that such a program is often used when developing a compiler (language translation program, usually programming language to computer bytecode/assembly), while being a compiler itself.

Today several YACC-style programs do exist, of which bison is probably the most well-known.

Also, it is very common to call a "YACC grammar" any grammar which is a valid input for YACC. (As well as sort of silly...)

LALR grammars are difficult to debug when conflicts occur. A tool called YCA "Yacc Conflict Analyzer" can be used to sort out why Yacc has encountered ambiguities.