tcl.pkg.tjc
Class TJC

java.lang.Object
  extended by tcl.pkg.tjc.TJC

public class TJC
extends Object


Nested Class Summary
static class TJC.CompiledCommand
           
 
Field Summary
static int EXPR_OP_BIT_AND
           
static int EXPR_OP_BIT_OR
           
static int EXPR_OP_BIT_XOR
           
static int EXPR_OP_DIVIDE
           
static int EXPR_OP_EQUAL
           
static int EXPR_OP_GEQ
           
static int EXPR_OP_GREATER
           
static int EXPR_OP_LEFT_SHIFT
           
static int EXPR_OP_LEQ
           
static int EXPR_OP_LESS
           
static int EXPR_OP_MINUS
           
static int EXPR_OP_MOD
           
static int EXPR_OP_MULT
           
static int EXPR_OP_NEQ
           
static int EXPR_OP_PLUS
           
static int EXPR_OP_RIGHT_SHIFT
           
static int EXPR_OP_STREQ
           
static int EXPR_OP_STRNEQ
           
static int EXPR_OP_UNARY_BIT_NOT
           
static int EXPR_OP_UNARY_MINUS
           
static int EXPR_OP_UNARY_NOT
           
static int EXPR_OP_UNARY_PLUS
           
static WrappedCommand INVALID_COMMAND_CACHE
           
static int SWITCH_MODE_EXACT
           
static int SWITCH_MODE_GLOB
           
static int SWITCH_MODE_REGEXP
           
 
Constructor Summary
TJC()
           
 
Method Summary
static TclObject appendVar(Interp interp, String varName, String key, TclObject[] values)
           
static void catchVarErr(Interp interp)
           
static void checkTclException(Interp interp, TclException e, String procName)
           
static void createCommand(Interp interp, String cmdName, TJC.CompiledCommand cmd)
           
static void evalProcBody(Interp interp, String body)
           
static void exprBinaryOperator(Interp interp, int op, ExprValue value, ExprValue value2)
           
static void exprDoubleMathFunction(Interp interp, ExprValue value)
           
static void exprEqualsEmptyString(ExprValue value, TclObject obj, boolean negate)
           
static double exprGetKnownDouble(TclObject tobj)
           
static long exprGetKnownInt(TclObject tobj)
           
static ExprValue exprGetValue(Interp interp)
           
static ExprValue exprGetValue(Interp interp, boolean bval)
           
static ExprValue exprGetValue(Interp interp, double dval, String srep)
           
static ExprValue exprGetValue(Interp interp, long ival, String srep)
           
static ExprValue exprGetValue(Interp interp, String srep)
           
static ExprValue exprGetValue(Interp interp, TclObject tobj)
           
static void exprInitValue(Interp interp, ExprValue value, TclObject tobj)
           
static void exprIntMathFunction(Interp interp, ExprValue value)
           
static void exprMathFunction(Interp interp, String funcName, ExprValue[] values, ExprValue result)
           
static void exprReleaseValue(Interp interp, ExprValue value)
           
static void exprSetResult(Interp interp, ExprValue value)
           
static void exprUnaryNotOperator(Interp interp, ExprValue value)
           
static void exprUnaryNotOperator(Interp interp, ExprValue value, TclObject tobj)
           
static void exprUnaryNotOperatorKnownInt(ExprValue value, TclObject tobj)
           
static int exprUnaryNotOperatorKnownInt(TclObject tobj)
           
static boolean exprUnaryNotOperatorKnownIntAsBoolean(TclObject tobj)
           
static void exprUnaryOperator(Interp interp, int op, ExprValue value)
           
static void foreachVarErr(Interp interp, String varname)
           
static boolean getBoolean(Interp interp, TclObject obj)
           
static TclObject[] grabObjv(Interp interp, int size)
           
static TclObject incrVar(Interp interp, String part1, String part2, long incrAmount)
          This method is invoked when a compiled incr command is inlined.
static Var[] initCompiledLocals(CallFrame frame, int size, String[] names)
           
static void invoke(Interp interp, Command cmd, TclObject[] objv, int flags)
           
static int invokeSwitch(Interp interp, TclObject[] pbObjv, int pbStart, String string, int mode)
           
static TclObject lappendVar(Interp interp, String varName, String key, TclObject[] values)
           
static void lindexNonconst(Interp interp, TclObject listObj, TclObject indexValue)
           
static void makeGlobalLinkVar(Interp interp, String varName, String varTail, int localIndex)
           
static void popLocalCallFrame(Interp interp, CallFrame frame)
           
static CallFrame pushLocalCallFrame(Interp interp, Namespace ns)
           
static void releaseObjv(Interp interp, TclObject[] objv, int size)
           
static void releaseObjvElems(Interp interp, TclObject[] objv, int size)
           
static WrappedCommand resolveCmd(Interp interp, String cmdName)
           
static void sourceInitFile(Interp interp, String init_file, String[] files, String prefix)
           
static TclObject stringFirst(Interp interp, String substr, String str, TclObject startObj)
           
static TclObject stringIndex(Interp interp, String str, TclObject indObj)
           
static TclObject stringLast(Interp interp, String substr, String str, TclObject lastObj)
           
static TclObject stringRange(Interp interp, String str, TclObject firstObj, TclObject lastObj)
           
static void switchStringIsNotOption(Interp interp, String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SWITCH_MODE_EXACT

public static final int SWITCH_MODE_EXACT
See Also:
Constant Field Values

SWITCH_MODE_GLOB

public static final int SWITCH_MODE_GLOB
See Also:
Constant Field Values

SWITCH_MODE_REGEXP

public static final int SWITCH_MODE_REGEXP
See Also:
Constant Field Values

EXPR_OP_MULT

public static final int EXPR_OP_MULT
See Also:
Constant Field Values

EXPR_OP_DIVIDE

public static final int EXPR_OP_DIVIDE
See Also:
Constant Field Values

EXPR_OP_MOD

public static final int EXPR_OP_MOD
See Also:
Constant Field Values

EXPR_OP_PLUS

public static final int EXPR_OP_PLUS
See Also:
Constant Field Values

EXPR_OP_MINUS

public static final int EXPR_OP_MINUS
See Also:
Constant Field Values

EXPR_OP_LEFT_SHIFT

public static final int EXPR_OP_LEFT_SHIFT
See Also:
Constant Field Values

EXPR_OP_RIGHT_SHIFT

public static final int EXPR_OP_RIGHT_SHIFT
See Also:
Constant Field Values

EXPR_OP_LESS

public static final int EXPR_OP_LESS
See Also:
Constant Field Values

EXPR_OP_GREATER

public static final int EXPR_OP_GREATER
See Also:
Constant Field Values

EXPR_OP_LEQ

public static final int EXPR_OP_LEQ
See Also:
Constant Field Values

EXPR_OP_GEQ

public static final int EXPR_OP_GEQ
See Also:
Constant Field Values

EXPR_OP_EQUAL

public static final int EXPR_OP_EQUAL
See Also:
Constant Field Values

EXPR_OP_NEQ

public static final int EXPR_OP_NEQ
See Also:
Constant Field Values

EXPR_OP_BIT_AND

public static final int EXPR_OP_BIT_AND
See Also:
Constant Field Values

EXPR_OP_BIT_XOR

public static final int EXPR_OP_BIT_XOR
See Also:
Constant Field Values

EXPR_OP_BIT_OR

public static final int EXPR_OP_BIT_OR
See Also:
Constant Field Values

EXPR_OP_STREQ

public static final int EXPR_OP_STREQ
See Also:
Constant Field Values

EXPR_OP_STRNEQ

public static final int EXPR_OP_STRNEQ
See Also:
Constant Field Values

EXPR_OP_UNARY_MINUS

public static final int EXPR_OP_UNARY_MINUS
See Also:
Constant Field Values

EXPR_OP_UNARY_PLUS

public static final int EXPR_OP_UNARY_PLUS
See Also:
Constant Field Values

EXPR_OP_UNARY_NOT

public static final int EXPR_OP_UNARY_NOT
See Also:
Constant Field Values

EXPR_OP_UNARY_BIT_NOT

public static final int EXPR_OP_UNARY_BIT_NOT
See Also:
Constant Field Values

INVALID_COMMAND_CACHE

public static final WrappedCommand INVALID_COMMAND_CACHE
Constructor Detail

TJC

public TJC()
Method Detail

pushLocalCallFrame

public static CallFrame pushLocalCallFrame(Interp interp,
                                           Namespace ns)

popLocalCallFrame

public static void popLocalCallFrame(Interp interp,
                                     CallFrame frame)

initCompiledLocals

public static Var[] initCompiledLocals(CallFrame frame,
                                       int size,
                                       String[] names)

evalProcBody

public static void evalProcBody(Interp interp,
                                String body)
                         throws TclException
Throws:
TclException

checkTclException

public static void checkTclException(Interp interp,
                                     TclException e,
                                     String procName)
                              throws TclException
Throws:
TclException

createCommand

public static void createCommand(Interp interp,
                                 String cmdName,
                                 TJC.CompiledCommand cmd)
                          throws TclException
Throws:
TclException

sourceInitFile

public static void sourceInitFile(Interp interp,
                                  String init_file,
                                  String[] files,
                                  String prefix)
                           throws TclException
Throws:
TclException

resolveCmd

public static WrappedCommand resolveCmd(Interp interp,
                                        String cmdName)
                                 throws TclException
Throws:
TclException

incrVar

public static final TclObject incrVar(Interp interp,
                                      String part1,
                                      String part2,
                                      long incrAmount)
                               throws TclException
This method is invoked when a compiled incr command is inlined. This methods works for both scalar variables and array scalars. This method is not used for cached variables.

Parameters:
interp - current interpreter
part1 - array name, or scalar name
part2 - array index
incrAmount - amount to increment
Returns:
tclobj
Throws:
TclException

grabObjv

public static TclObject[] grabObjv(Interp interp,
                                   int size)

releaseObjv

public static void releaseObjv(Interp interp,
                               TclObject[] objv,
                               int size)

releaseObjvElems

public static void releaseObjvElems(Interp interp,
                                    TclObject[] objv,
                                    int size)

invoke

public static void invoke(Interp interp,
                          Command cmd,
                          TclObject[] objv,
                          int flags)
                   throws TclException
Throws:
TclException

getBoolean

public static boolean getBoolean(Interp interp,
                                 TclObject obj)
                          throws TclException
Throws:
TclException

invokeSwitch

public static int invokeSwitch(Interp interp,
                               TclObject[] pbObjv,
                               int pbStart,
                               String string,
                               int mode)
                        throws TclException
Throws:
TclException

switchStringIsNotOption

public static void switchStringIsNotOption(Interp interp,
                                           String str)
                                    throws TclException
Throws:
TclException

catchVarErr

public static void catchVarErr(Interp interp)
                        throws TclException
Throws:
TclException

foreachVarErr

public static void foreachVarErr(Interp interp,
                                 String varname)
                          throws TclException
Throws:
TclException

exprReleaseValue

public static void exprReleaseValue(Interp interp,
                                    ExprValue value)

exprGetValue

public static ExprValue exprGetValue(Interp interp,
                                     long ival,
                                     String srep)
                              throws TclException
Throws:
TclException

exprGetValue

public static ExprValue exprGetValue(Interp interp,
                                     double dval,
                                     String srep)
                              throws TclException
Throws:
TclException

exprGetValue

public static ExprValue exprGetValue(Interp interp,
                                     String srep)
                              throws TclException
Throws:
TclException

exprGetValue

public static ExprValue exprGetValue(Interp interp,
                                     boolean bval)
                              throws TclException
Throws:
TclException

exprGetValue

public static ExprValue exprGetValue(Interp interp,
                                     TclObject tobj)
                              throws TclException
Throws:
TclException

exprInitValue

public static void exprInitValue(Interp interp,
                                 ExprValue value,
                                 TclObject tobj)
                          throws TclException
Throws:
TclException

exprGetValue

public static ExprValue exprGetValue(Interp interp)

exprGetKnownInt

public static long exprGetKnownInt(TclObject tobj)

exprGetKnownDouble

public static double exprGetKnownDouble(TclObject tobj)

exprUnaryOperator

public static void exprUnaryOperator(Interp interp,
                                     int op,
                                     ExprValue value)
                              throws TclException
Throws:
TclException

exprBinaryOperator

public static void exprBinaryOperator(Interp interp,
                                      int op,
                                      ExprValue value,
                                      ExprValue value2)
                               throws TclException
Throws:
TclException

exprMathFunction

public static void exprMathFunction(Interp interp,
                                    String funcName,
                                    ExprValue[] values,
                                    ExprValue result)
                             throws TclException
Throws:
TclException

exprSetResult

public static void exprSetResult(Interp interp,
                                 ExprValue value)
                          throws TclException
Throws:
TclException

exprEqualsEmptyString

public static void exprEqualsEmptyString(ExprValue value,
                                         TclObject obj,
                                         boolean negate)
                                  throws TclException
Throws:
TclException

exprIntMathFunction

public static void exprIntMathFunction(Interp interp,
                                       ExprValue value)
                                throws TclException
Throws:
TclException

exprDoubleMathFunction

public static void exprDoubleMathFunction(Interp interp,
                                          ExprValue value)
                                   throws TclException
Throws:
TclException

exprUnaryNotOperator

public static void exprUnaryNotOperator(Interp interp,
                                        ExprValue value)
                                 throws TclException
Throws:
TclException

exprUnaryNotOperator

public static void exprUnaryNotOperator(Interp interp,
                                        ExprValue value,
                                        TclObject tobj)
                                 throws TclException
Throws:
TclException

exprUnaryNotOperatorKnownInt

public static void exprUnaryNotOperatorKnownInt(ExprValue value,
                                                TclObject tobj)

exprUnaryNotOperatorKnownInt

public static int exprUnaryNotOperatorKnownInt(TclObject tobj)

exprUnaryNotOperatorKnownIntAsBoolean

public static boolean exprUnaryNotOperatorKnownIntAsBoolean(TclObject tobj)

makeGlobalLinkVar

public static final void makeGlobalLinkVar(Interp interp,
                                           String varName,
                                           String varTail,
                                           int localIndex)
                                    throws TclException
Throws:
TclException

lindexNonconst

public static final void lindexNonconst(Interp interp,
                                        TclObject listObj,
                                        TclObject indexValue)
                                 throws TclException
Throws:
TclException

lappendVar

public static final TclObject lappendVar(Interp interp,
                                         String varName,
                                         String key,
                                         TclObject[] values)
                                  throws TclException
Throws:
TclException

appendVar

public static final TclObject appendVar(Interp interp,
                                        String varName,
                                        String key,
                                        TclObject[] values)
                                 throws TclException
Throws:
TclException

stringIndex

public static final TclObject stringIndex(Interp interp,
                                          String str,
                                          TclObject indObj)
                                   throws TclException
Throws:
TclException

stringRange

public static final TclObject stringRange(Interp interp,
                                          String str,
                                          TclObject firstObj,
                                          TclObject lastObj)
                                   throws TclException
Throws:
TclException

stringFirst

public static final TclObject stringFirst(Interp interp,
                                          String substr,
                                          String str,
                                          TclObject startObj)
                                   throws TclException
Throws:
TclException

stringLast

public static final TclObject stringLast(Interp interp,
                                         String substr,
                                         String str,
                                         TclObject lastObj)
                                  throws TclException
Throws:
TclException


Copyright © 2015. All rights reserved.