oscript.translator
Class ShorthandFunctionPrimaryPrefixTranslator

java.lang.Object
  extended byoscript.translator.ShorthandFunctionPrimaryPrefixTranslator

public class ShorthandFunctionPrimaryPrefixTranslator
extends java.lang.Object

A translator to implement one part of the language in terms of another. This simplifies the compiler/interpreter implementation. This translates from:

   "'{" Program "}"
 
to
   "function" "(" "args..." ")" "{" Program "}"
 

Version:
0.1
Author:
Rob Clark

Constructor Summary
ShorthandFunctionPrimaryPrefixTranslator()
           
 
Method Summary
static Node translate(ShorthandFunctionPrimaryPrefix n)
          Convert a ShorthandFunctionPrimaryPrefix production in the syntaxtree into an equivalent production.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShorthandFunctionPrimaryPrefixTranslator

public ShorthandFunctionPrimaryPrefixTranslator()
Method Detail

translate

public static Node translate(ShorthandFunctionPrimaryPrefix n)
Convert a ShorthandFunctionPrimaryPrefix production in the syntaxtree into an equivalent production.
 f0 -> "'{"
 f1 -> Program(true)
 f2 -> "}"