use of org.apache.asterix.om.base.AMutableString in project asterixdb by apache.
the class FunctionalTester method print_version.
/*********************************************************************
* Function: print_version
* Purpose:
*********************************************************************/
public static void print_version() {
AMutableString classad_version = new AMutableString(null);
ClassAd.classAdLibraryVersion(classad_version);
System.out.println("ClassAd Functional Tester v" + classad_version.getStringValue());
return;
}
use of org.apache.asterix.om.base.AMutableString in project asterixdb by apache.
the class FunctionalTester method handle_eval.
/*********************************************************************
* Function: handle_eval
* Purpose:
*
* @throws IOException
*********************************************************************/
public static void handle_eval(AMutableString line, State state, Parameters parameters, ClassAdObjectPool objectPool) throws IOException {
AMutableString variable_name = new AMutableString("");
ExprTree tree;
Variable variable;
if (get_variable_name(line, true, variable_name, state, parameters)) {
tree = get_expr(line, state, parameters, objectPool);
if (tree != null) {
Value value = new Value(objectPool);
if (!evaluate_expr(tree, value, parameters, objectPool)) {
print_error_message("Couldn't evaluate rvalue", state);
} else {
variable = new Variable(variable_name.getStringValue(), value);
variables.put(variable_name.getStringValue(), variable);
}
}
}
return;
}
use of org.apache.asterix.om.base.AMutableString in project asterixdb by apache.
the class FunctionalTester method test.
// typedef map<string, Variable *> VariableMap;
/*--------------------------------------------------------------------
*
* Private Functions
*
*--------------------------------------------------------------------*/
public static int test(int argc, String[] argv, ClassAdObjectPool objectPool) throws IOException {
// here
boolean quit;
AMutableString line = new AMutableString(null);
State state = new State();
Parameters parameters = new Parameters();
print_version();
parameters.parseCommandLine(argc, argv);
quit = false;
while (!quit && readLine(line, state, parameters) == true) {
boolean good_line;
Command command;
good_line = replace_variables(line, state, parameters, objectPool);
if (good_line) {
command = get_command(line, parameters);
quit = handle_command(command, line, state, parameters, objectPool);
}
}
print_final_state(state);
if (!parameters.interactive && parameters.inputFile != null) {
parameters.inputFile.close();
}
if (state.number_of_errors == 0) {
return 0;
} else {
return 1;
}
}
use of org.apache.asterix.om.base.AMutableString in project asterixdb by apache.
the class ClassAdUnitTester method printVersion.
/*********************************************************************
* Function: print_version
* Purpose:
*********************************************************************/
public static void printVersion() {
AMutableString classadVersion = new AMutableString(null);
ClassAd.classAdLibraryVersion(classadVersion);
System.out.println("ClassAd Unit Tester v" + classadVersion + "\n");
}
use of org.apache.asterix.om.base.AMutableString in project asterixdb by apache.
the class FunctionalTester method handle_let.
/*********************************************************************
* Function: handle_let
* Purpose:
*
* @throws IOException
*********************************************************************/
public static void handle_let(AMutableString line, State state, Parameters parameters, ClassAdObjectPool objectPool) throws IOException {
AMutableString variable_name = new AMutableString(null);
ExprTree tree;
Variable variable;
if (get_variable_name(line, true, variable_name, state, parameters)) {
tree = get_expr(line, state, parameters, objectPool);
if (tree != null) {
variable = new Variable(variable_name.getStringValue(), tree, objectPool);
variables.put(variable_name.getStringValue(), variable);
if (parameters.interactive) {
print_expr(tree, state, parameters, objectPool);
}
}
}
return;
}
Aggregations