org.jawk.intermediate
Class AwkTuples

java.lang.Object
  extended by org.jawk.intermediate.AwkTuples
All Implemented Interfaces:
java.io.Serializable

public class AwkTuples
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int _ADD_
          Numerically adds the top two elements of the stack with the result pushed onto the stack.
static int _APPLY_RS_
          Apply the RS variable by notifying the partitioning reader that there is a new regular expression to use when partitioning input records.
static int _APPLY_SUBSEP_
           
static int _ARGC_OFFSET_
          Assign the ARGC variable offset.
static int _ARGV_OFFSET_
          Assign the ARGV variable offset.
static int _ASSIGN_
          Assigns the top-of-stack to a variable.
static int _ASSIGN_ARRAY_
          Assigns an item to an array element.
static int _ASSIGN_AS_INPUT_
          Assigns the top-of-stack to $0.
static int _ASSIGN_AS_INPUT_FIELD_
          Assigns an item as a particular input field; the field number can be 0.
static int _ATAN2_
          Built-in function that pops the first two items off the stack, calls the java.lang.Math.atan2 method with these as arguments, and places the result onto the stack.
static int _CALL_FUNCTION_
           
static int _CAST_DOUBLE_
           
static int _CAST_INT_
           
static int _CAST_STRING_
           
static int _CHECK_CLASS_
          Checks whether the top-of-stack is of a particular class type; if not, an AwkRuntimeException is thrown.
static int _CLOSE_
           
static int _CMP_EQ_
          Compares the top two stack elements; pushes 1 onto the stack if equal, 0 if not equal.
static int _CMP_GT_
          Compares the top two stack elements; pushes 1 onto the stack if x1 > x2, 0 if not equal.
static int _CMP_LT_
          Compares the top two stack elements; pushes 1 onto the stack if x1 < x2, 0 if not equal.
static int _CONCAT_
          Pop and concatinate two strings from the top-of-stack; push the result onto the stack.
static int _CONSUME_INPUT_
          Consume next line of input; assigning $0 and recalculating $1, $2, etc.
static int _CONVFMT_OFFSET_
          Assign the CONVFMT variable offset.
static int _COS_
          Built-in function that pops the top-of-stack, calls the java.lang.Math.cos method with the top-of-stack as the argument, and places the result onto the stack.
static int _DEC_
          Decreases the variable reference by one; pushes the result onto the stack.
static int _DEC_ARRAY_REF_
          Decreases the array element reference by one; pushes the result onto the stack.
static int _DEC_DOLLAR_REF_
          Decreases the input field variable by one; pushes the result onto the stack.
static int _DELETE_ARRAY_
           
static int _DELETE_ARRAY_ELEMENT_
           
static int _DEREF_ARRAY_
           
static int _DEREFERENCE_
          Obtains an item from the variable manager and push it onto the stack.
static int _DIV_EQ_
          Divides the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _DIV_EQ_ARRAY_
          Divides the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _DIV_EQ_INPUT_FIELD_
          Divides the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _DIVIDE_
          Numerically divides the top two elements of the stack with the result pushed onto the stack.
static int _DUMP_
           
static int _DUP_
          Duplicates the top-of-stack on the stack.
static int _ENVIRON_OFFSET_
          Assign the ENVIRON variable offset.
static int _EXEC_
           
static int _EXIT_WITH_CODE_
           
static int _EXP_
          Built-in function that pops the top-of-stack, calls the java.lang.Math.exp method with the top-of-stack as the argument, and places the result onto the stack.
static int _EXTENSION_
           
static int _FILENAME_OFFSET_
          Assign the FILENAME variable offset.
static int _FNR_OFFSET_
          Assign the FNR variable offset.
static int _FS_OFFSET_
          Assign the FS variable offset.
static int _FUNCTION_
           
static int _GET_FIRST_AND_REMOVE_FROM_KEYLIST_
          Removes an item from the KeyList (set) and pushes it onto the operand stack.
static int _GET_INPUT_FIELD_
          Push an input field onto the stack.
static int _GETLINE_INPUT_
          Obtains input from stdin/filename-args and pushes input line and status code onto the stack.
static int _GOTO_
          Jumps to a specified address.
static int _IFFALSE_
          Pops and evaluates the top-of-stack; if false, it jumps to a specified address.
static int _IFTRUE_
          Pops and evaluates the top-of-stack; if true, it jumps to a specified address.
static int _INC_
          Increases the variable reference by one; pushes the result onto the stack.
static int _INC_ARRAY_REF_
          Increases the array element reference by one; pushes the result onto the stack.
static int _INC_DOLLAR_REF_
          Increases the input field variable by one; pushes the result onto the stack.
static int _INDEX_
          Built-in function that locates a substring within a source string and pushes the location onto the stack.
static int _INTFUNC_
          Built-in function that pops the top-of-stack, removes its fractional part, if any, and places the result onto the stack.
static int _IS_EMPTY_KEYLIST_
          Tests whether the KeyList (set) is empty; jumps to the argument address if empty, steps to the next instruction if not.
static int _IS_IN_
           
static int _KEYLIST_
          Retrieves and pushes a Set of keys from an associative array onto the stack.
static int _LENGTH_
          Depending on the argument, pop and evaluate the string length of the top-of-stack or evaluate the string length of $0; in either case, push the result onto the stack.
static int _LOG_
          Built-in function that pops the top-of-stack, calls the java.lang.Math.log method with the top-of-stack as the argument, and places the result onto the stack.
static int _MATCH_
          Built-in function that searches a string as input to a regular expression, the location of the match is pushed onto the stack.
static int _MATCHES_
          Applies a regular expression to the top stack element; pushes 1 if it matches, 0 if it does not match.
static int _MINUS_EQ_
          Decreases the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _MINUS_EQ_ARRAY_
          Decreases the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _MINUS_EQ_INPUT_FIELD_
          Decreases the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _MOD_
          Numerically takes the modulus of the top two elements of the stack with the result pushed onto the stack.
static int _MOD_EQ_
          Takes the modulues of the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _MOD_EQ_ARRAY_
          Takes the modulus of the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _MOD_EQ_INPUT_FIELD_
          Takes the modulus of the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _MULT_EQ_
          Multiplies the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _MULT_EQ_ARRAY_
          Multiplies the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _MULT_EQ_INPUT_FIELD_
          Multiplies the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _MULTIPLY_
          Numerically multiplies the top two elements of the stack with the result pushed onto the stack.
static int _NEGATE_
          Evalutes the numerical NEGATION of the top stack element; pushes the result onto the stack.
static int _NF_OFFSET_
          Assign the NF variable offset.
static int _NOP_
          A no-operation.
static int _NOT_
          Evaluates the logical NOT of the top stack element; pushes the result onto the stack.
static int _NR_OFFSET_
          Assign the NR variable offset.
static int _OFMT_OFFSET_
          Assign the OFMT variable offset.
static int _OFS_OFFSET_
          Assign the OFS variable offset.
static int _PLUS_EQ_
          Increase the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _PLUS_EQ_ARRAY_
          Increase the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _PLUS_EQ_INPUT_FIELD_
          Increases the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _POP_
          Pops an item off the operand stack.
static int _POW_
          Numerically raises the top element to the power of the next element with the result pushed onto the stack.
static int _POW_EQ_
          Raises the contents of the variable to the power of the adjustment value; assigns the result to the variable and pushes the result onto the stack.
static int _POW_EQ_ARRAY_
          Raises the contents of an indexed array to the power of an adjustment value; assigns the result to the array and pushes the result onto the stack.
static int _POW_EQ_INPUT_FIELD_
          Raises the contents of an input field to the power of an adjustment value; assigns the result to the input field and pushes the result onto the stack.
static int _PRINT_
          Prints N number of items that are on the operand stack.
static int _PRINT_TO_FILE_
          Prints N number of items that are on the operand stack to a specified file.
static int _PRINT_TO_PIPE_
          Prints N number of items that are on the operand stack to a process executing a specified command (via a pipe).
static int _PRINTF_
          Performs a formatted print of N items that are on the operand stack.
static int _PRINTF_TO_FILE_
          Performs a formatted print of N items that are on the operand stack to a specified file.
static int _PRINTF_TO_PIPE_
          Performs a formatted print of N items that are on the operand stack to a process executing a specified command (via a pipe).
static int _PUSH_
          Pushes an item onto the operand stack.
static int _RAND_
          Obtains the next random number from the random number generator and push it onto the stack.
static int _REGEXP_
           
static int _REGEXP_PAIR_
           
static int _RETURN_FROM_FUNCTION_
           
static int _RLENGTH_OFFSET_
          Assign the RLENGTH variable offset.
static int _RS_OFFSET_
          Assign the RS variable offset.
static int _RSTART_OFFSET_
          Assign the RSTART variable offset.
static int _SET_EXIT_ADDRESS_
           
static int _SET_NUM_GLOBALS_
           
static int _SET_RETURN_RESULT_
           
static int _SET_WITHIN_END_BLOCKS_
           
static int _SIN_
          Built-in function that pops the top-of-stack, calls the java.lang.Math.sin method with the top-of-stack as the argument, and places the result onto the stack.
static int _SLEEP_
          Extension: Pauses the execution thread by N number of seconds.
static int _SPLIT_
          Built-in function to split a string by a regexp and put the components into an array.
static int _SPRINTF_
           
static int _SQRT_
          Built-in function that pops the top-of-stack, takes its square root, and places the result onto the stack.
static int _SRAND_
          Seeds the random number generator.
static int _SUB_FOR_ARRAY_REFERENCE_
          Built-in function that substitutes an occurance (or all occurances) of a string in a particular array cell and replaces it with another.
static int _SUB_FOR_DOLLAR_0_
          Built-in function that substitutes an occurance (or all occurances) of a string in $0 and replaces it with another.
static int _SUB_FOR_DOLLAR_REFERENCE_
          Built-in function that substitutes an occurance (or all occurances) of a string in a field reference and replaces it with another.
static int _SUB_FOR_VARIABLE_
          Built-in function that substitutes an occurance (or all occurances) of a string in a particular variable and replaces it with another.
static int _SUBSEP_OFFSET_
          Assign the SUBSEP variable offset.
static int _SUBSTR_
          Built-in function that pushes a substring of the top-of-stack onto the stack.
static int _SUBTRACT_
          Numerically subtracts the top two elements of the stack with the result pushed onto the stack.
static int _SWAP_
          Swaps the top two elements of the stack.
static int _SYSTEM_
          Built-in function that executes the top-of-stack as a system command and pushes the return code onto the stack.
static int _THIS_
           
static int _TO_NUMBER_
          Converts the top-of-stack to a number.
static int _TOLOWER_
          Built-in function that converts all the letters in the top-of-stack to lower case and pushes the result onto the stack.
static int _TOUPPER_
          Built-in function that converts all the letters in the top-of-stack to upper case and pushes the result onto the stack.
static int _USE_AS_COMMAND_INPUT_
          Obtains input from a command (process) and pushes input line and status code onto the stack.
static int _USE_AS_FILE_INPUT_
          Obtains input from a file and pushes input line and status code onto the stack.
 
Constructor Summary
AwkTuples()
           
 
Method Summary
 void add()
           
 void addGlobalVariableNameToOffsetMapping(java.lang.String varname, int offset, boolean is_aarray)
          Accept a {variable_name -> offset} mapping such that global variables can be assigned while processing name=value and filename command-line arguments.
 AwkTuples address(Address address)
           
 void applyRS()
           
 void applySubsep(int count)
           
 void argcOffset(int offset)
           
 void argvOffset(int offset)
           
 void assign(int offset, boolean is_global)
           
 void assignArray(int offset, boolean is_global)
           
 void assignAsInput()
           
 void assignAsInputField()
           
 void atan2()
           
 void callFunction(HasFunctionAddress has_func_addr, java.lang.String func_name, int num_formal_params, int num_actual_params)
           
 void castDouble()
           
 void castInt()
           
 void castString()
           
 boolean checkClass(java.lang.Class cls)
           
 void close()
           
 void cmpEq()
           
 void cmpGt()
           
 void cmpLt()
           
 void concat()
           
 void consumeInput(Address address)
           
 void convfmtOffset(int offset)
           
 void cos()
           
 Address createAddress(java.lang.String label)
           
 void dec(int offset, boolean is_global)
           
 void decArrayRef(int offset, boolean is_global)
           
 void decDollarRef()
           
 void deleteArray(int offset, boolean is_global)
           
 void deleteArrayElement(int offset, boolean is_global)
           
 void dereference(int offset, boolean is_array, boolean is_global)
           
 void dereferenceArray()
           
 void divEq(int offset, boolean is_global)
           
 void divEqArray(int offset, boolean is_global)
           
 void divEqInputField()
           
 void divide()
           
 void dump(int num_args)
           
 void dump(java.io.PrintStream ps)
           
 void dup()
           
 void environOffset(int offset)
           
 void exec()
           
 void exitWithCode()
           
 void exp()
           
 void extension(java.lang.String extension_keyword, int param_count, boolean is_initial)
           
 void filenameOffset(int offset)
           
 void fnrOffset(int offset)
           
 void fsOffset(int offset)
           
 void function(java.lang.String func_name, int num_formal_params)
           
 void getFirstAndRemoveFromList()
           
 java.util.Set<java.lang.String> getFunctionNameSet()
           
 java.util.Map<java.lang.String,java.lang.Boolean> getGlobalVariableAarrayMap()
           
 java.util.Map<java.lang.String,java.lang.Integer> getGlobalVariableOffsetMap()
           
 void getInputField()
           
 void getlineInput()
           
 void gotoAddress(Address address)
           
 void ifFalse(Address address)
           
 void ifTrue(Address address)
           
 void inc(int offset, boolean is_global)
           
 void incArrayRef(int offset, boolean is_global)
           
 void incDollarRef()
           
 void index()
           
 void intFunc()
           
 void isEmptyList(Address address)
           
 void isIn()
           
 void keylist()
           
 void length(int num_exprs)
           
 void log()
           
 void match()
           
 void matches()
           
 void minusEq(int offset, boolean is_global)
           
 void minusEqArray(int offset, boolean is_global)
           
 void minusEqInputField()
           
 void mod()
           
 void modEq(int offset, boolean is_global)
           
 void modEqArray(int offset, boolean is_global)
           
 void modEqInputField()
           
 void multEq(int offset, boolean is_global)
           
 void multEqArray(int offset, boolean is_global)
           
 void multEqInputField()
           
 void multiply()
           
 void negate()
           
 void nfOffset(int offset)
           
 void nop()
           
 void not()
           
 void nrOffset(int offset)
           
 void ofmtOffset(int offset)
           
 void ofsOffset(int offset)
           
 void plusEq(int offset, boolean is_global)
           
 void plusEqArray(int offset, boolean is_global)
           
 void plusEqInputField()
           
 void pop()
           
 void popSourceLineNumber(int lineno)
           
 void postProcess()
          Executed after all tuples are entered in the queue.
 void pow()
           
 void powEq(int offset, boolean is_global)
           
 void powEqArray(int offset, boolean is_global)
           
 void powEqInputField()
           
 void print(int num_exprs)
           
 void printf(int num_exprs)
           
 void printfToFile(int num_exprs, boolean append)
           
 void printfToPipe(int num_exprs)
           
 void printToFile(int num_exprs, boolean append)
           
 void printToPipe(int num_exprs)
           
 void push(java.lang.Object o)
           
 void pushSourceLineNumber(int lineno)
          Push the current line number onto the line number stack.
 void rand()
           
 void regexp(java.lang.String regexp_str)
           
 void regexpPair()
           
 void returnFromFunction()
           
 void rlengthOffset(int offset)
           
 void rsOffset(int offset)
           
 void rstartOffset(int offset)
           
 void scriptThis()
           
 void setExitAddress(Address addr)
           
 void setFunctionNameSet(java.util.Set<java.lang.String> function_names)
          Accept a set of function names from the parser.
 void setNumGlobals(int num_globals)
           
 void setReturnResult()
           
 void setWithinEndBlocks(boolean b)
           
 void sin()
           
 void sleep(int num_args)
           
 void split(int numargs)
           
 void sprintf(int num_exprs)
           
 void sqrt()
           
 void srand(int num)
           
 void subForArrayReference(int offset, boolean is_global, boolean is_gsub)
           
 void subForDollar0(boolean is_gsub)
           
 void subForDollarReference(boolean is_gsub)
           
 void subForVariable(int offset, boolean is_global, boolean is_gsub)
           
 void subsepOffset(int offset)
           
 void substr(int numargs)
           
 void subtract()
           
 void swap()
           
 void system()
           
 void tolower()
           
 void toNumber()
           
static java.lang.String toOpcodeString(int opcode)
           
 Position top()
           
 void toupper()
           
 void useAsCommandInput()
           
 void useAsFileInput()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_POP_

public static final int _POP_
Pops an item off the operand stack.

Stack before: x ...
Stack after: ...

See Also:
Constant Field Values

_PUSH_

public static final int _PUSH_
Pushes an item onto the operand stack.

Stack before: ...
Stack after: x ...

See Also:
Constant Field Values

_IFFALSE_

public static final int _IFFALSE_
Pops and evaluates the top-of-stack; if false, it jumps to a specified address.

Argument: address

Stack before: x ...
Stack after: ...

See Also:
Constant Field Values

_TO_NUMBER_

public static final int _TO_NUMBER_
Converts the top-of-stack to a number.

Stack before: x ...
Stack after: x (as a number)

See Also:
Constant Field Values

_IFTRUE_

public static final int _IFTRUE_
Pops and evaluates the top-of-stack; if true, it jumps to a specified address.

Argument: address

Stack before: x ...
Stack after: ...

See Also:
Constant Field Values

_GOTO_

public static final int _GOTO_
Jumps to a specified address. The operand stack contents are unaffected.

See Also:
Constant Field Values

_NOP_

public static final int _NOP_
A no-operation. The operand stack contents are unaffected.

See Also:
Constant Field Values

_PRINT_

public static final int _PRINT_
Prints N number of items that are on the operand stack. The number of items are passed in as a tuple argument.

Argument: # of items (N)

Stack before: x1 x2 x3 .. xN ...
Stack after: ...

See Also:
Constant Field Values

_PRINT_TO_FILE_

public static final int _PRINT_TO_FILE_
Prints N number of items that are on the operand stack to a specified file. The file is passed in on the stack. The number of items are passed in as a tuple argument, as well as whether to overwrite the file or not (append mode).

Argument 1: # of items (N)
Argument 2: true = append, false = overwrite

Stack before: x1 x2 x3 .. xN filename ...
Stack after: ...

See Also:
Constant Field Values

_PRINT_TO_PIPE_

public static final int _PRINT_TO_PIPE_
Prints N number of items that are on the operand stack to a process executing a specified command (via a pipe). The command string is passed in on the stack. The number of items are passed in as a tuple argument.

Argument: # of items (N)

Stack before: x1 x2 x3 .. xN command-string ...
Stack after: ...

See Also:
Constant Field Values

_PRINTF_

public static final int _PRINTF_
Performs a formatted print of N items that are on the operand stack. The number of items are passed in as a tuple argument.

Argument: # of items (N)

Stack before: x1 x2 x3 .. xN ...
Stack after: ...

See Also:
Constant Field Values

_PRINTF_TO_FILE_

public static final int _PRINTF_TO_FILE_
Performs a formatted print of N items that are on the operand stack to a specified file. The file is passed in on the stack. The number of items are passed in as a tuple argument, as well as whether to overwrite the file or not (append mode).

Argument 1: # of items (N)
Argument 2: true = append, false = overwrite

Stack before: x1 x2 x3 .. xN filename ...
Stack after: ...

See Also:
Constant Field Values

_PRINTF_TO_PIPE_

public static final int _PRINTF_TO_PIPE_
Performs a formatted print of N items that are on the operand stack to a process executing a specified command (via a pipe). The command string is passed in on the stack. The number of items are passed in as a tuple argument.

Argument: # of items (N)

Stack before: x1 x2 x3 .. xN command-string ...
Stack after: ...

See Also:
Constant Field Values

_SPRINTF_

public static final int _SPRINTF_
See Also:
Constant Field Values

_LENGTH_

public static final int _LENGTH_
Depending on the argument, pop and evaluate the string length of the top-of-stack or evaluate the string length of $0; in either case, push the result onto the stack.

The input field length evaluation mode is provided to support backward compatibility with the deprecated usage of length (i.e., no arguments).

Argument: 0 to use $0, use top-of-stack otherwise

If argument is 0:

Stack before: ...
Stack after: length-of-$0 ...
else
Stack before: x ...
Stack after: length-of-x ...

See Also:
Constant Field Values

_CONCAT_

public static final int _CONCAT_
Pop and concatinate two strings from the top-of-stack; push the result onto the stack.

Stack before: x y ...
Stack after: x-concatenated-with-y ...

See Also:
Constant Field Values

_ASSIGN_

public static final int _ASSIGN_
Assigns the top-of-stack to a variable. The contents of the stack are unaffected.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: x ...
Stack after: x ...

See Also:
Constant Field Values

_ASSIGN_ARRAY_

public static final int _ASSIGN_ARRAY_
Assigns an item to an array element. The item remains on the stack.

Argument 1: offset of the particular associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: index-into-array item ...
Stack after: item ...

See Also:
Constant Field Values

_ASSIGN_AS_INPUT_

public static final int _ASSIGN_AS_INPUT_
Assigns the top-of-stack to $0. The contents of the stack are unaffected. Upon assignment, individual field variables are recalculated.

Stack before: x ...
Stack after: x ...

See Also:
Constant Field Values

_ASSIGN_AS_INPUT_FIELD_

public static final int _ASSIGN_AS_INPUT_FIELD_
Assigns an item as a particular input field; the field number can be 0. Upon assignment, associating input fields are affected. For example, if the following assignment were made:
 $3 = "hi"
 
$0 would be recalculated. Likewise, if the following assignment were made:
 $0 = "hello there"
 
$1, $2, ... would be recalculated.

Stack before: field-num x ...
Stack after: x ...

See Also:
Constant Field Values

_DEREFERENCE_

public static final int _DEREFERENCE_
Obtains an item from the variable manager and push it onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: ...
Stack after: x ...

See Also:
Constant Field Values

_PLUS_EQ_

public static final int _PLUS_EQ_
Increase the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x+n ...

See Also:
Constant Field Values

_MINUS_EQ_

public static final int _MINUS_EQ_
Decreases the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x-n ...

See Also:
Constant Field Values

_MULT_EQ_

public static final int _MULT_EQ_
Multiplies the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x*n ...

See Also:
Constant Field Values

_DIV_EQ_

public static final int _DIV_EQ_
Divides the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x/n ...

See Also:
Constant Field Values

_MOD_EQ_

public static final int _MOD_EQ_
Takes the modulues of the contents of the variable by an adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x%n ...

See Also:
Constant Field Values

_POW_EQ_

public static final int _POW_EQ_
Raises the contents of the variable to the power of the adjustment value; assigns the result to the variable and pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: n ...
Stack after: x^n ...

See Also:
Constant Field Values

_PLUS_EQ_ARRAY_

public static final int _PLUS_EQ_ARRAY_
Increase the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x+n ...

See Also:
Constant Field Values

_MINUS_EQ_ARRAY_

public static final int _MINUS_EQ_ARRAY_
Decreases the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x-n ...

See Also:
Constant Field Values

_MULT_EQ_ARRAY_

public static final int _MULT_EQ_ARRAY_
Multiplies the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x*n ...

See Also:
Constant Field Values

_DIV_EQ_ARRAY_

public static final int _DIV_EQ_ARRAY_
Divides the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x/n ...

See Also:
Constant Field Values

_MOD_EQ_ARRAY_

public static final int _MOD_EQ_ARRAY_
Takes the modulus of the contents of an indexed array by an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x%n ...

See Also:
Constant Field Values

_POW_EQ_ARRAY_

public static final int _POW_EQ_ARRAY_
Raises the contents of an indexed array to the power of an adjustment value; assigns the result to the array and pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx n ...
Stack after: x^n ...

See Also:
Constant Field Values

_PLUS_EQ_INPUT_FIELD_

public static final int _PLUS_EQ_INPUT_FIELD_
Increases the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x+n ...

See Also:
Constant Field Values

_MINUS_EQ_INPUT_FIELD_

public static final int _MINUS_EQ_INPUT_FIELD_
Decreases the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x-n ...

See Also:
Constant Field Values

_MULT_EQ_INPUT_FIELD_

public static final int _MULT_EQ_INPUT_FIELD_
Multiplies the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x*n ...

See Also:
Constant Field Values

_DIV_EQ_INPUT_FIELD_

public static final int _DIV_EQ_INPUT_FIELD_
Divides the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x/n ...

See Also:
Constant Field Values

_MOD_EQ_INPUT_FIELD_

public static final int _MOD_EQ_INPUT_FIELD_
Takes the modulus of the contents of an input field by an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x%n ...

See Also:
Constant Field Values

_POW_EQ_INPUT_FIELD_

public static final int _POW_EQ_INPUT_FIELD_
Raises the contents of an input field to the power of an adjustment value; assigns the result to the input field and pushes the result onto the stack.

Stack before: input-field_number n ...
Stack after: x^n ...

See Also:
Constant Field Values

_SRAND_

public static final int _SRAND_
Seeds the random number generator. If there are no arguments, the current time (as a long value) is used as the seed. Otherwise, the top-of-stack is popped and used as the seed value.

Argument: # of arguments

If # of arguments is 0:

Stack before: ...
Stack after: old-seed ...
else
Stack before: x ...
Stack after: old-seed ...

See Also:
Constant Field Values

_RAND_

public static final int _RAND_
Obtains the next random number from the random number generator and push it onto the stack.

Stack before: ...
Stack after: random-number ...

See Also:
Constant Field Values

_INTFUNC_

public static final int _INTFUNC_
Built-in function that pops the top-of-stack, removes its fractional part, if any, and places the result onto the stack.

Stack before: x ...
Stack after: (int)x ...

See Also:
Constant Field Values

_SQRT_

public static final int _SQRT_
Built-in function that pops the top-of-stack, takes its square root, and places the result onto the stack.

Stack before: x ...
Stack after: sqrt(x) ...

See Also:
Constant Field Values

_LOG_

public static final int _LOG_
Built-in function that pops the top-of-stack, calls the java.lang.Math.log method with the top-of-stack as the argument, and places the result onto the stack.

Stack before: x ...
Stack after: log(x) ...

See Also:
Constant Field Values

_EXP_

public static final int _EXP_
Built-in function that pops the top-of-stack, calls the java.lang.Math.exp method with the top-of-stack as the argument, and places the result onto the stack.

Stack before: x ...
Stack after: exp(x) ...

See Also:
Constant Field Values

_SIN_

public static final int _SIN_
Built-in function that pops the top-of-stack, calls the java.lang.Math.sin method with the top-of-stack as the argument, and places the result onto the stack.

Stack before: x ...
Stack after: sin(x) ...

See Also:
Constant Field Values

_COS_

public static final int _COS_
Built-in function that pops the top-of-stack, calls the java.lang.Math.cos method with the top-of-stack as the argument, and places the result onto the stack.

Stack before: x ...
Stack after: cos(x) ...

See Also:
Constant Field Values

_ATAN2_

public static final int _ATAN2_
Built-in function that pops the first two items off the stack, calls the java.lang.Math.atan2 method with these as arguments, and places the result onto the stack.

Stack before: x1 x2 ...
Stack after: atan2(x1,x2) ...

See Also:
Constant Field Values

_MATCH_

public static final int _MATCH_
Built-in function that searches a string as input to a regular expression, the location of the match is pushed onto the stack. The RSTART and RLENGTH variables are set as a side effect. If a match is found, RSTART and function return value are set to the location of the match and RLENGTH is set to the length of the substring matched against the regular expression. If no match is found, RSTART (and return value) is set to 0 and RLENGTH is set to -1.

Stack before: string regexp ...
Stack after: RSTART ...

See Also:
Constant Field Values

_INDEX_

public static final int _INDEX_
Built-in function that locates a substring within a source string and pushes the location onto the stack. If the substring is not found, 0 is pushed onto the stack.

Stack before: string substring ...
Stack after: location-index ...

See Also:
Constant Field Values

_SUB_FOR_DOLLAR_0_

public static final int _SUB_FOR_DOLLAR_0_
Built-in function that substitutes an occurance (or all occurances) of a string in $0 and replaces it with another.

Argument: true if global sub, false otherwise.

Stack before: regexp replacement-string ...
Stack after: ...

See Also:
Constant Field Values

_SUB_FOR_DOLLAR_REFERENCE_

public static final int _SUB_FOR_DOLLAR_REFERENCE_
Built-in function that substitutes an occurance (or all occurances) of a string in a field reference and replaces it with another.

Argument: true if global sub, false otherwise.

Stack before: field-num regexp replacement-string ...
Stack after: ...

See Also:
Constant Field Values

_SUB_FOR_VARIABLE_

public static final int _SUB_FOR_VARIABLE_
Built-in function that substitutes an occurance (or all occurances) of a string in a particular variable and replaces it with another.

Argument 1: variable offset in variable manager
Argument 2: is global variable
Argument 3: is global sub

Stack before: regexp replacement-string orig-string ...
Stack after: ...

See Also:
Constant Field Values

_SUB_FOR_ARRAY_REFERENCE_

public static final int _SUB_FOR_ARRAY_REFERENCE_
Built-in function that substitutes an occurance (or all occurances) of a string in a particular array cell and replaces it with another.

Argument 1: array map offset in variable manager
Argument 2: is global array map
Argument 3: is global sub

Stack before: array-index regexp replacement-string orig-string ...
Stack after: ...

See Also:
Constant Field Values

_SPLIT_

public static final int _SPLIT_
Built-in function to split a string by a regexp and put the components into an array.

Argument: # of arguments (parameters on stack)

If # of arguments is 2:

Stack before: string array ...
Stack after: n ...
else
Stack before: string array regexp ...
Stack after: n ...

See Also:
Constant Field Values

_SUBSTR_

public static final int _SUBSTR_
Built-in function that pushes a substring of the top-of-stack onto the stack. The tuple argument indicates whether to limit the substring to a particular end position, or to take the substring up to the end-of-string.

Argument: # of arguments

If # of arguments is 2:

Stack before: string startpos ...
Stack after: substring ...
else
Stack before: string startpos endpos ...
Stack after: substring ...

See Also:
Constant Field Values

_TOLOWER_

public static final int _TOLOWER_
Built-in function that converts all the letters in the top-of-stack to lower case and pushes the result onto the stack.

Stack before: STRING-ARGUMENT ...
Stack after: string-argument ...

See Also:
Constant Field Values

_TOUPPER_

public static final int _TOUPPER_
Built-in function that converts all the letters in the top-of-stack to upper case and pushes the result onto the stack.

Stack before: string-argument ...
Stack after: STRING-ARGUMENT ...

See Also:
Constant Field Values

_SYSTEM_

public static final int _SYSTEM_
Built-in function that executes the top-of-stack as a system command and pushes the return code onto the stack.

Stack before: cmd ...
Stack after: return-code ...

See Also:
Constant Field Values

_SWAP_

public static final int _SWAP_
Swaps the top two elements of the stack.

Stack before: x1 x2 ...
Stack after: x2 x1 ...

See Also:
Constant Field Values

_ADD_

public static final int _ADD_
Numerically adds the top two elements of the stack with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1+x2 ...

See Also:
Constant Field Values

_SUBTRACT_

public static final int _SUBTRACT_
Numerically subtracts the top two elements of the stack with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1-x2 ...

See Also:
Constant Field Values

_MULTIPLY_

public static final int _MULTIPLY_
Numerically multiplies the top two elements of the stack with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1*x2 ...

See Also:
Constant Field Values

_DIVIDE_

public static final int _DIVIDE_
Numerically divides the top two elements of the stack with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1/x2 ...

See Also:
Constant Field Values

_MOD_

public static final int _MOD_
Numerically takes the modulus of the top two elements of the stack with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1%x2 ...

See Also:
Constant Field Values

_POW_

public static final int _POW_
Numerically raises the top element to the power of the next element with the result pushed onto the stack.

Stack before: x1 x2 ...
Stack after: x1^x2 ...

See Also:
Constant Field Values

_INC_

public static final int _INC_
Increases the variable reference by one; pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: ...
Stack after: x+1 ...

See Also:
Constant Field Values

_DEC_

public static final int _DEC_
Decreases the variable reference by one; pushes the result onto the stack.

Argument 1: offset of the particular variable into the variable manager
Argument 2: whether the variable is global or local

Stack before: ...
Stack after: x-1 ...

See Also:
Constant Field Values

_INC_ARRAY_REF_

public static final int _INC_ARRAY_REF_
Increases the array element reference by one; pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx ...
Stack after: x+1 ...

See Also:
Constant Field Values

_DEC_ARRAY_REF_

public static final int _DEC_ARRAY_REF_
Decreases the array element reference by one; pushes the result onto the stack.

Argument 1: offset of the associative array into the variable manager
Argument 2: whether the associative array is global or local

Stack before: array-idx ...
Stack after: x-1 ...

See Also:
Constant Field Values

_INC_DOLLAR_REF_

public static final int _INC_DOLLAR_REF_
Increases the input field variable by one; pushes the result onto the stack.

Stack before: field-idx ...
Stack after: x+1

See Also:
Constant Field Values

_DEC_DOLLAR_REF_

public static final int _DEC_DOLLAR_REF_
Decreases the input field variable by one; pushes the result onto the stack.

Stack before: field-idx ...
Stack after: x-1

See Also:
Constant Field Values

_DUP_

public static final int _DUP_
Duplicates the top-of-stack on the stack.

Stack before: x ...
Stack after: x x ...

See Also:
Constant Field Values

_NOT_

public static final int _NOT_
Evaluates the logical NOT of the top stack element; pushes the result onto the stack.

Stack before: x ...
Stack after: !x ...

See Also:
Constant Field Values

_NEGATE_

public static final int _NEGATE_
Evalutes the numerical NEGATION of the top stack element; pushes the result onto the stack.

Stack before: x ...
Stack after: -x ...

See Also:
Constant Field Values

_CMP_EQ_

public static final int _CMP_EQ_
Compares the top two stack elements; pushes 1 onto the stack if equal, 0 if not equal.

Stack before: x1 x2 ...
Stack after: x1==x2

See Also:
Constant Field Values

_CMP_LT_

public static final int _CMP_LT_
Compares the top two stack elements; pushes 1 onto the stack if x1 < x2, 0 if not equal.

Stack before: x1 x2 ...
Stack after: x1<x2

See Also:
Constant Field Values

_CMP_GT_

public static final int _CMP_GT_
Compares the top two stack elements; pushes 1 onto the stack if x1 > x2, 0 if not equal.

Stack before: x1 x2 ...
Stack after: x1>x2

See Also:
Constant Field Values

_MATCHES_

public static final int _MATCHES_
Applies a regular expression to the top stack element; pushes 1 if it matches, 0 if it does not match.

Stack before: x1 x2 ...
Stack after: (x1 ~ /x2/) ...

See Also:
Constant Field Values

_SLEEP_

public static final int _SLEEP_
Extension: Pauses the execution thread by N number of seconds.

Stack before: N ...
Stack after: ...

See Also:
Constant Field Values

_DUMP_

public static final int _DUMP_
See Also:
Constant Field Values

_DEREF_ARRAY_

public static final int _DEREF_ARRAY_
See Also:
Constant Field Values

_KEYLIST_

public static final int _KEYLIST_
Retrieves and pushes a Set of keys from an associative array onto the stack. The Set is tagged with a KeyList interface.

Stack before: associative-array ...
Stack after: keylist-set ...

See Also:
Constant Field Values

_IS_EMPTY_KEYLIST_

public static final int _IS_EMPTY_KEYLIST_
Tests whether the KeyList (set) is empty; jumps to the argument address if empty, steps to the next instruction if not.

Argument: jump-address-if-empty

Stack before: keylist ...
Stack after: ...

See Also:
Constant Field Values

_GET_FIRST_AND_REMOVE_FROM_KEYLIST_

public static final int _GET_FIRST_AND_REMOVE_FROM_KEYLIST_
Removes an item from the KeyList (set) and pushes it onto the operand stack.

Stack before: keylist ...
Stack after: 1st-item ...

See Also:
Constant Field Values

_CHECK_CLASS_

public static final int _CHECK_CLASS_
Checks whether the top-of-stack is of a particular class type; if not, an AwkRuntimeException is thrown. The stack remains unchanged upon a successful check.

Argument: class-type (i.e., KeyList.class)

Stack before: obj ...
Stack after: obj ...

See Also:
Constant Field Values

_GET_INPUT_FIELD_

public static final int _GET_INPUT_FIELD_
Push an input field onto the stack.

Stack before: field-id ...
Stack after: x ...

See Also:
Constant Field Values

_CONSUME_INPUT_

public static final int _CONSUME_INPUT_
Consume next line of input; assigning $0 and recalculating $1, $2, etc. The input can come from the following sources: The operand stack is unaffected.

See Also:
Constant Field Values

_GETLINE_INPUT_

public static final int _GETLINE_INPUT_
Obtains input from stdin/filename-args and pushes input line and status code onto the stack. The input is partitioned into records based on the RS variable assignment as a regular expression.

If there is input available, the input string and a return code of 1 is pushed. If EOF is reached, a blank (null) string ("") is pushed along with a 0 return code. Upon an IO error, a blank string and a -1 is pushed onto the operand stack.

Stack before: ...
Stack after: input-string return-code ...

See Also:
Constant Field Values

_USE_AS_FILE_INPUT_

public static final int _USE_AS_FILE_INPUT_
Obtains input from a file and pushes input line and status code onto the stack. The input is partitioned into records based on the RS variable assignment as a regular expression.

Upon initial execution, the file is opened and the handle is maintained until it is explicitly closed, or until the VM exits. Subsequent calls will obtain subsequent lines (records) of input until no more records are available.

If there is input available, the input string and a return code of 1 is pushed. If EOF is reached, a blank (null) string ("") is pushed along with a 0 return code. Upon an IO error, a blank string and a -1 is pushed onto the operand stack.

Stack before: filename ...
Stack after: input-string return-code ...

See Also:
Constant Field Values

_USE_AS_COMMAND_INPUT_

public static final int _USE_AS_COMMAND_INPUT_
Obtains input from a command (process) and pushes input line and status code onto the stack. The input is partitioned into records based on the RS variable assignment as a regular expression.

Upon initial execution, the a process is spawned to execute the specified command and the process reference is maintained until it is explicitly closed, or until the VM exits. Subsequent calls will obtain subsequent lines (records) of input until no more records are available.

If there is input available, the input string and a return code of 1 is pushed. If EOF is reached, a blank (null) string ("") is pushed along with a 0 return code. Upon an IO error, a blank string and a -1 is pushed onto the operand stack.

Stack before: command-line ...
Stack after: input-string return-code ...

See Also:
Constant Field Values

_NF_OFFSET_

public static final int _NF_OFFSET_
Assign the NF variable offset. This is important for the AVM to set the variables as new input lines are processed.

The operand stack is unaffected.

See Also:
Constant Field Values

_NR_OFFSET_

public static final int _NR_OFFSET_
Assign the NR variable offset. This is important for the AVM to increase the record number as new input lines received.

The operand stack is unaffected.

See Also:
Constant Field Values

_FNR_OFFSET_

public static final int _FNR_OFFSET_
Assign the FNR variable offset. This is important for the AVM to increase the "file" record number as new input lines are received.

The operand stack is unaffected.

See Also:
Constant Field Values

_FS_OFFSET_

public static final int _FS_OFFSET_
Assign the FS variable offset. This is important for the AVM to know how to split fields upon incoming records of input.

The operand stack is unaffected.

See Also:
Constant Field Values

_RS_OFFSET_

public static final int _RS_OFFSET_
Assign the RS variable offset. This is important for the AVM to know how to create records from the stream(s) of input.

The operand stack is unaffected.

See Also:
Constant Field Values

_OFS_OFFSET_

public static final int _OFS_OFFSET_
Assign the OFS variable offset. This is important for the AVM to use when outputting expressions via PRINT.

The operand stack is unaffected.

See Also:
Constant Field Values

_RSTART_OFFSET_

public static final int _RSTART_OFFSET_
Assign the RSTART variable offset. The AVM sets this variable while executing the match() builtin function.

The operand stack is unaffected.

See Also:
Constant Field Values

_RLENGTH_OFFSET_

public static final int _RLENGTH_OFFSET_
Assign the RLENGTH variable offset. The AVM sets this variable while executing the match() builtin function.

The operand stack is unaffected.

See Also:
Constant Field Values

_FILENAME_OFFSET_

public static final int _FILENAME_OFFSET_
Assign the FILENAME variable offset. The AVM sets this variable while processing files from the command-line for input.

The operand stack is unaffected.

See Also:
Constant Field Values

_SUBSEP_OFFSET_

public static final int _SUBSEP_OFFSET_
Assign the SUBSEP variable offset. The AVM uses this variable while building an index of a multi-dimensional array.

The operand stack is unaffected.

See Also:
Constant Field Values

_CONVFMT_OFFSET_

public static final int _CONVFMT_OFFSET_
Assign the CONVFMT variable offset. The AVM uses this variable while converting numbers to strings.

The operand stack is unaffected.

See Also:
Constant Field Values

_OFMT_OFFSET_

public static final int _OFMT_OFFSET_
Assign the OFMT variable offset. The AVM uses this variable while converting numbers to strings for printing.

The operand stack is unaffected.

See Also:
Constant Field Values

_ENVIRON_OFFSET_

public static final int _ENVIRON_OFFSET_
Assign the ENVIRON variable offset. The AVM provides environment variables through this array.

The operand stack is unaffected.

See Also:
Constant Field Values

_ARGC_OFFSET_

public static final int _ARGC_OFFSET_
Assign the ARGC variable offset. The AVM provides the number of arguments via this variable.

The operand stack is unaffected.

See Also:
Constant Field Values

_ARGV_OFFSET_

public static final int _ARGV_OFFSET_
Assign the ARGV variable offset. The AVM provides command-line arguments via this variable.

The operand stack is unaffected.

See Also:
Constant Field Values

_APPLY_RS_

public static final int _APPLY_RS_
Apply the RS variable by notifying the partitioning reader that there is a new regular expression to use when partitioning input records.

The stack remains unaffected.

See Also:
Constant Field Values

_CALL_FUNCTION_

public static final int _CALL_FUNCTION_
See Also:
Constant Field Values

_FUNCTION_

public static final int _FUNCTION_
See Also:
Constant Field Values

_SET_RETURN_RESULT_

public static final int _SET_RETURN_RESULT_
See Also:
Constant Field Values

_RETURN_FROM_FUNCTION_

public static final int _RETURN_FROM_FUNCTION_
See Also:
Constant Field Values

_SET_NUM_GLOBALS_

public static final int _SET_NUM_GLOBALS_
See Also:
Constant Field Values

_CLOSE_

public static final int _CLOSE_
See Also:
Constant Field Values

_APPLY_SUBSEP_

public static final int _APPLY_SUBSEP_
See Also:
Constant Field Values

_DELETE_ARRAY_ELEMENT_

public static final int _DELETE_ARRAY_ELEMENT_
See Also:
Constant Field Values

_SET_EXIT_ADDRESS_

public static final int _SET_EXIT_ADDRESS_
See Also:
Constant Field Values

_SET_WITHIN_END_BLOCKS_

public static final int _SET_WITHIN_END_BLOCKS_
See Also:
Constant Field Values

_EXIT_WITH_CODE_

public static final int _EXIT_WITH_CODE_
See Also:
Constant Field Values

_REGEXP_

public static final int _REGEXP_
See Also:
Constant Field Values

_REGEXP_PAIR_

public static final int _REGEXP_PAIR_
See Also:
Constant Field Values

_IS_IN_

public static final int _IS_IN_
See Also:
Constant Field Values

_CAST_INT_

public static final int _CAST_INT_
See Also:
Constant Field Values

_CAST_DOUBLE_

public static final int _CAST_DOUBLE_
See Also:
Constant Field Values

_CAST_STRING_

public static final int _CAST_STRING_
See Also:
Constant Field Values

_THIS_

public static final int _THIS_
See Also:
Constant Field Values

_EXTENSION_

public static final int _EXTENSION_
See Also:
Constant Field Values

_EXEC_

public static final int _EXEC_
See Also:
Constant Field Values

_DELETE_ARRAY_

public static final int _DELETE_ARRAY_
See Also:
Constant Field Values
Constructor Detail

AwkTuples

public AwkTuples()
Method Detail

toOpcodeString

public static java.lang.String toOpcodeString(int opcode)

pop

public void pop()

push

public void push(java.lang.Object o)

ifFalse

public void ifFalse(Address address)

toNumber

public void toNumber()

ifTrue

public void ifTrue(Address address)

gotoAddress

public void gotoAddress(Address address)

createAddress

public Address createAddress(java.lang.String label)

address

public AwkTuples address(Address address)

nop

public void nop()

print

public void print(int num_exprs)

printToFile

public void printToFile(int num_exprs,
                        boolean append)

printToPipe

public void printToPipe(int num_exprs)

printf

public void printf(int num_exprs)

printfToFile

public void printfToFile(int num_exprs,
                         boolean append)

printfToPipe

public void printfToPipe(int num_exprs)

sprintf

public void sprintf(int num_exprs)

length

public void length(int num_exprs)

concat

public void concat()

assign

public void assign(int offset,
                   boolean is_global)

assignArray

public void assignArray(int offset,
                        boolean is_global)

assignAsInput

public void assignAsInput()

assignAsInputField

public void assignAsInputField()

dereference

public void dereference(int offset,
                        boolean is_array,
                        boolean is_global)

plusEq

public void plusEq(int offset,
                   boolean is_global)

minusEq

public void minusEq(int offset,
                    boolean is_global)

multEq

public void multEq(int offset,
                   boolean is_global)

divEq

public void divEq(int offset,
                  boolean is_global)

modEq

public void modEq(int offset,
                  boolean is_global)

powEq

public void powEq(int offset,
                  boolean is_global)

plusEqArray

public void plusEqArray(int offset,
                        boolean is_global)

minusEqArray

public void minusEqArray(int offset,
                         boolean is_global)

multEqArray

public void multEqArray(int offset,
                        boolean is_global)

divEqArray

public void divEqArray(int offset,
                       boolean is_global)

modEqArray

public void modEqArray(int offset,
                       boolean is_global)

powEqArray

public void powEqArray(int offset,
                       boolean is_global)

plusEqInputField

public void plusEqInputField()

minusEqInputField

public void minusEqInputField()

multEqInputField

public void multEqInputField()

divEqInputField

public void divEqInputField()

modEqInputField

public void modEqInputField()

powEqInputField

public void powEqInputField()

srand

public void srand(int num)

rand

public void rand()

intFunc

public void intFunc()

sqrt

public void sqrt()

log

public void log()

exp

public void exp()

sin

public void sin()

cos

public void cos()

atan2

public void atan2()

match

public void match()

index

public void index()

subForDollar0

public void subForDollar0(boolean is_gsub)

subForDollarReference

public void subForDollarReference(boolean is_gsub)

subForVariable

public void subForVariable(int offset,
                           boolean is_global,
                           boolean is_gsub)

subForArrayReference

public void subForArrayReference(int offset,
                                 boolean is_global,
                                 boolean is_gsub)

split

public void split(int numargs)

substr

public void substr(int numargs)

tolower

public void tolower()

toupper

public void toupper()

system

public void system()

exec

public void exec()

swap

public void swap()

add

public void add()

subtract

public void subtract()

multiply

public void multiply()

divide

public void divide()

mod

public void mod()

pow

public void pow()

inc

public void inc(int offset,
                boolean is_global)

dec

public void dec(int offset,
                boolean is_global)

incArrayRef

public void incArrayRef(int offset,
                        boolean is_global)

decArrayRef

public void decArrayRef(int offset,
                        boolean is_global)

incDollarRef

public void incDollarRef()

decDollarRef

public void decDollarRef()

dup

public void dup()

not

public void not()

negate

public void negate()

cmpEq

public void cmpEq()

cmpLt

public void cmpLt()

cmpGt

public void cmpGt()

matches

public void matches()

sleep

public void sleep(int num_args)

dump

public void dump(int num_args)

dereferenceArray

public void dereferenceArray()

keylist

public void keylist()

isEmptyList

public void isEmptyList(Address address)

getFirstAndRemoveFromList

public void getFirstAndRemoveFromList()

checkClass

public boolean checkClass(java.lang.Class cls)

getInputField

public void getInputField()

consumeInput

public void consumeInput(Address address)

getlineInput

public void getlineInput()

useAsFileInput

public void useAsFileInput()

useAsCommandInput

public void useAsCommandInput()

nfOffset

public void nfOffset(int offset)

nrOffset

public void nrOffset(int offset)

fnrOffset

public void fnrOffset(int offset)

fsOffset

public void fsOffset(int offset)

rsOffset

public void rsOffset(int offset)

ofsOffset

public void ofsOffset(int offset)

rstartOffset

public void rstartOffset(int offset)

rlengthOffset

public void rlengthOffset(int offset)

filenameOffset

public void filenameOffset(int offset)

subsepOffset

public void subsepOffset(int offset)

convfmtOffset

public void convfmtOffset(int offset)

ofmtOffset

public void ofmtOffset(int offset)

environOffset

public void environOffset(int offset)

argcOffset

public void argcOffset(int offset)

argvOffset

public void argvOffset(int offset)

applyRS

public void applyRS()

function

public void function(java.lang.String func_name,
                     int num_formal_params)

callFunction

public void callFunction(HasFunctionAddress has_func_addr,
                         java.lang.String func_name,
                         int num_formal_params,
                         int num_actual_params)

setReturnResult

public void setReturnResult()

returnFromFunction

public void returnFromFunction()

setNumGlobals

public void setNumGlobals(int num_globals)

close

public void close()

applySubsep

public void applySubsep(int count)

deleteArrayElement

public void deleteArrayElement(int offset,
                               boolean is_global)

deleteArray

public void deleteArray(int offset,
                        boolean is_global)

setExitAddress

public void setExitAddress(Address addr)

setWithinEndBlocks

public void setWithinEndBlocks(boolean b)

exitWithCode

public void exitWithCode()

regexp

public void regexp(java.lang.String regexp_str)

regexpPair

public void regexpPair()

isIn

public void isIn()

castInt

public void castInt()

castDouble

public void castDouble()

castString

public void castString()

scriptThis

public void scriptThis()

extension

public void extension(java.lang.String extension_keyword,
                      int param_count,
                      boolean is_initial)

dump

public void dump(java.io.PrintStream ps)

top

public Position top()

postProcess

public void postProcess()
Executed after all tuples are entered in the queue. Its main functions are:


addGlobalVariableNameToOffsetMapping

public void addGlobalVariableNameToOffsetMapping(java.lang.String varname,
                                                 int offset,
                                                 boolean is_aarray)
Accept a {variable_name -> offset} mapping such that global variables can be assigned while processing name=value and filename command-line arguments.


setFunctionNameSet

public void setFunctionNameSet(java.util.Set<java.lang.String> function_names)
Accept a set of function names from the parser. This is useful for invalidating name=value assignments from the command line parameters, either via -v arguments or passed into ARGV.

Parameters:
function_names - A set of function name strings.

getGlobalVariableOffsetMap

public java.util.Map<java.lang.String,java.lang.Integer> getGlobalVariableOffsetMap()

getGlobalVariableAarrayMap

public java.util.Map<java.lang.String,java.lang.Boolean> getGlobalVariableAarrayMap()

getFunctionNameSet

public java.util.Set<java.lang.String> getFunctionNameSet()

pushSourceLineNumber

public void pushSourceLineNumber(int lineno)
Push the current line number onto the line number stack. This is called by the parser to keep track of the current source line number. Keeping track of line numbers this way allows the runtime to report more meaningful errors by providing source line numbers within error reports.

Parameters:
lineno - The current source line number.

popSourceLineNumber

public void popSourceLineNumber(int lineno)