templates.yacc.yacc.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cookcc Show documentation
Show all versions of cookcc Show documentation
CookCC - a Lexer / Parser (LALR(1)) Project
<#if code?has_content && code.fileheader?has_content>
%{
${code.fileheader}
%}
<#if tokens?has_content>
<#list tokens as i><#if i.tokens?has_content>
<#if i.type?has_content>%${i.type}<#else>%nonassoc<#list i.tokens as j> ${j}
<#if parser.start?has_content>
%start ${parser.start}
%%
<#list parser.grammars as grammar>
${grammar.rule}
<#list grammar.rhs as rhs>
<#if rhs_index == 0>:<#else>| ${rhs.terms}<#if rhs.precedence?has_content> %prec ${rhs.precedence}
<#if rhs.action?has_content>
{${rhs.action}}
;
%%
<#if code?has_content && code.default?has_content>
${code.default}