net.scheinerman.phoenix.interpreter.functions
Class BuiltInFunction

java.lang.Object
  extended by net.scheinerman.phoenix.interpreter.Interpreter
      extended by net.scheinerman.phoenix.interpreter.functions.Function
          extended by net.scheinerman.phoenix.interpreter.functions.BuiltInFunction
Direct Known Subclasses:
InteractivePhoenixEnvironment.InteractiveFunctions.About, InteractivePhoenixEnvironment.InteractiveFunctions.Copyright, InteractivePhoenixEnvironment.InteractiveFunctions.Exit, InteractivePhoenixEnvironment.InteractiveFunctions.Help, InteractivePhoenixEnvironment.InteractiveFunctions.License, InteractivePhoenixEnvironment.InteractiveFunctions.Search, MathFunctions.Abs, MathFunctions.ArcCos, MathFunctions.ArcSin, MathFunctions.ArcTan, MathFunctions.Ceil, MathFunctions.Cos, MathFunctions.CosH, MathFunctions.E, MathFunctions.Exp, MathFunctions.Factorial, MathFunctions.Floor, MathFunctions.Hypot, MathFunctions.Log, MathFunctions.Log10, MathFunctions.LogB, MathFunctions.Max, MathFunctions.Min, MathFunctions.PI, MathFunctions.Random, MathFunctions.RandomInt, MathFunctions.Root, MathFunctions.Sin, MathFunctions.SinH, MathFunctions.Sqrt, MathFunctions.Tan, MathFunctions.TanH, SetFunctions.Add, SetFunctions.Clear, SetFunctions.Contains, SetFunctions.Create, SetFunctions.CreateFromStack, SetFunctions.Delete, SetFunctions.Exists, SetFunctions.Size, StackFunctions.Clear, StackFunctions.Create, StackFunctions.Delete, StackFunctions.Exists, StackFunctions.Peek, StackFunctions.Pop, StackFunctions.Push, StackFunctions.Size, StringFunctions.InLowerCase, StringFunctions.InUpperCase, StringFunctions.Length, SystemFunctions.Arg, SystemFunctions.AsNumber, SystemFunctions.AsString, SystemFunctions.ErrorMessage, SystemFunctions.Exit, SystemFunctions.Print, SystemFunctions.PrintLn, SystemFunctions.Tic, SystemFunctions.Toc

public abstract class BuiltInFunction
extends Function


Field Summary
 
Fields inherited from class net.scheinerman.phoenix.interpreter.functions.Function
af_names, af_types, argDescriptions, b4_names, b4_types, description, modifiers, name, returnDescription
 
Fields inherited from class net.scheinerman.phoenix.interpreter.Interpreter
_break, _continue, _return, breakValue, code, fat, file, keywordList, line, line_diff, printValues, retType, retTypeSet, retValue, run_code, stop, vat
 
Constructor Summary
BuiltInFunction(java.lang.String name, java.lang.String retType, java.lang.String[] left, java.lang.String[] right, java.lang.String[] leftNames, java.lang.String[] rightNames)
           
BuiltInFunction(java.lang.String prefix, java.lang.String name, java.lang.String retType, java.lang.String[] left, java.lang.String[] right, java.lang.String[] leftNames, java.lang.String[] rightNames)
           
 
Method Summary
private  Variable[] convertStrToVar(java.lang.String[] args)
           
private  java.lang.String[] convertVarToStr(Variable[] args)
           
abstract  void run(java.lang.String[] left, java.lang.String[] right)
           
 void run(Variable[] b4_args, Variable[] af_args)
          Runs this function with the given left-hand and right-hand arguments.
 
Methods inherited from class net.scheinerman.phoenix.interpreter.functions.Function
addArgs, check, dealWithReturn, getAfterNames, getAfterTypes, getBeforeNames, getBeforeTypes, getDefinition, getName, printHelp, setModifiers, setName, setVATandFAT, toString
 
Methods inherited from class net.scheinerman.phoenix.interpreter.Interpreter
dealWithBreak, dealWithContinue, dealWithError, delete, doRun, getBlock, getFunction, getFunctionArguments, getFunctionFromDefinition, getReturnValue, getVariable, getWhitespace, initNewTables, isValidIdentifier, makeDefaultVariable, makeFunction, makeVariable, makeVariable, parsePhrase, putFunction, removeComments, removeWhitespace, retValueMatches, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuiltInFunction

public BuiltInFunction(java.lang.String name,
                       java.lang.String retType,
                       java.lang.String[] left,
                       java.lang.String[] right,
                       java.lang.String[] leftNames,
                       java.lang.String[] rightNames)

BuiltInFunction

public BuiltInFunction(java.lang.String prefix,
                       java.lang.String name,
                       java.lang.String retType,
                       java.lang.String[] left,
                       java.lang.String[] right,
                       java.lang.String[] leftNames,
                       java.lang.String[] rightNames)
Method Detail

convertStrToVar

private Variable[] convertStrToVar(java.lang.String[] args)

convertVarToStr

private java.lang.String[] convertVarToStr(Variable[] args)

run

public final void run(Variable[] b4_args,
                      Variable[] af_args)
Description copied from class: Function
Runs this function with the given left-hand and right-hand arguments. If these arguments do not match the given variable types passed to the constructor, a SyntaxException will be thrown.

Overrides:
run in class Function
Parameters:
b4_args - - The left-hand arguments.
af_args - - The right-hand arguments.

run

public abstract void run(java.lang.String[] left,
                         java.lang.String[] right)