All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.antlr.codegen.templates.Ruby.ST.stg Maven / Gradle / Ivy

There is a newer version: 3.5.3
Show newest version
@parserBody.mixins() ::= <<
<@super.mixins()>

include ANTLR3::Template::RewriteBuilder

include ANTLR3::Template::Builder

>>

gatedAction( block ) ::= <<

if 
  
end



>>

/** x+=rule when output=template */
ruleRefAndListLabel(rule,label,elementIndex,args,scope) ::= <<

.template}, ...)>
>>

rewriteTemplate(alts) ::= <<

}; anchor, separator="\n\n">

})>
>>

rewriteTemplateAltFirst(a) ::= <<

if 
  # 
  return_value.template = 

# 
return_value.template = 

>>

rewriteTemplateAltRest(a) ::= <<

if 
  # 
  return_value.template = 

e 
  # 
  return_value.template = 
end

>>

replaceTextInLine() ::= <<

@input.token_stream.replace(
  @input.adaptor.token_start_index( return_value.start ),
  @input.adaptor.token_stop_index( return_value.start ),
  return_value.template
)

@input.replace(
  return_value.start.index,
  @input.look( -1 ).index,
  return_value.template
)

>>

rewriteEmptyTemplate(alts) ::= <<
nil
>>

/** Invoke a template with a set of attribute name/value pairs.
 *  Set the value of the rule's template *after* having set
 *  the attributes because the rule's template might be used as
 *  an attribute to build a bigger template; you get a self-embedded
 *  template.
 */
rewriteExternalTemplate(name,args) ::= <<
fetch_template( "" ,
  
)
>>

/** expr is a string expression that says what template to load */
rewriteIndirectTemplate(expr,args) ::= <<
fetch_template( ,  )
>>

/** Invoke an inline template with a set of attribute name/value pairs */
rewriteInlineTemplate(args, template) ::= <<
create_template( "