/** * Resolve a token to a directve name. * * @return The code for the directive. */ DirectiveKeyword RexxToken::keyDirective() { // not a symbol? not a keyword if (!isSymbol()) { return DIRECTIVE_NONE; } return static_cast<DirectiveKeyword>(resolveKeyword(stringValue, directives, tabSize(directives))); }
/** * Resolve a token to a builtin identifier. * * @return The builtin code. */ BuiltinCode RexxToken::builtin() { // This can be a symbol or a literal if (!isSymbolOrLiteral()) { return NO_BUILTIN; } return static_cast<BuiltinCode>(resolveKeyword(stringValue, builtinFunctions, tabSize(builtinFunctions))); }
/** * Resolve a builtin name to a function code. * * @param value The value to check. * * @return The corresponding builtin code. */ BuiltinCode RexxToken::resolveBuiltin(RexxString *value) { return static_cast<BuiltinCode>(resolveKeyword(value, builtinFunctions, tabSize(builtinFunctions))); }
/** * Resolve a token to a parse option keyword. * * @return The corresponding keyword code. */ InstructionSubKeyword RexxToken::parseOption() { // not a symbol? not a keyword if (!isSymbol()) { return SUBKEY_NONE; } return static_cast<InstructionSubKeyword>(resolveKeyword(stringValue, parseOptions, tabSize(parseOptions))); }
/** * Resolve a condition name to a keyword code. * * @return The keyword code corresponding to the condition name. */ ConditionKeyword RexxToken::condition() { // not a symbol? not a keyword if (!isSymbol()) { return CONDITION_NONE; } return static_cast<ConditionKeyword>(resolveKeyword(stringValue, conditionKeywords, tabSize(conditionKeywords))); }
/** * Resolve a token to a keyword value. * * @return The keyword identifier. */ InstructionKeyword RexxToken::keyword() { // not a symbol? not a keyword if (!isSymbol()) { return KEYWORD_NONE; } return static_cast<InstructionKeyword>(resolveKeyword(stringValue, keywordInstructions, tabSize(keywordInstructions))); }
/** Change the tab size. Default is 2. */ static void setTabSize(int ts) {tabSize() = ts;}