YACC: Difference between revisions
m (Gleki moved page jbocre: YACC to YACC without leaving a redirect: Text replace - "jbocre: ([A-Z])" to "$1") |
m (Text replace - "jbocre: ([A-Z])" to "$1") |
||
Line 1: | Line 1: | ||
YACC, an acronym for "Yet Another Compiler Compiler", is the name of a program which takes the description of a [[ | YACC, an acronym for "Yet Another Compiler Compiler", is the name of a program which takes the description of a [[LALR|LALR]](1) grammar and generates C code able to parse this grammar as output, written a long time ago (1974-75) for [[UNIX|UNIX]] systems. | ||
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. | 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. | ||
Line 8: | Line 8: | ||
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...'') | 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 [[ | LALR grammars are difficult to debug when conflicts occur. A tool called [[YCA|YCA]] "Yacc Conflict Analyzer" can be used to sort out why Yacc has encountered ambiguities. |
Revision as of 16:15, 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.