19 package org.turro.parser;
22 import java.io.IOException;
23 import java.io.PrintWriter;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.turro.elephant.context.IConstructor;
27 import org.turro.elephant.impl.util.FileUtil;
28 import org.turro.elephant.impl.util.Files;
29 import org.turro.marker.ElephantMarker;
39 protected PrintWriter
out;
58 for(
int i = 1; i <
tokens.length; i++) {
79 protected String
getToken(String name,
boolean defParameter) {
84 protected String
getToken(String name, String def) {
93 protected String
getToken(
int index,
boolean defParameter) {
94 if(
tokens.length > index) {
101 if(
tokens.length > index) {
122 }
catch (IOException ex) {
127 private void initParser() {
131 private ParserParameter getParameter(String name) {
133 if(pm.getMacroName().equals(
tokens[0])) {
134 for(ParserParameter pp : pm.getParameters()) {
135 if(pp.getName().equals(name)) {
144 private ParserParameter getParameter(
int index) {
146 if(pm.getMacroName().equals(
tokens[0])) {
147 for(ParserParameter pp : pm.getParameters()) {
148 if(pp.getOrder() == index) {
static Properties getOrderedProperties(File file)
static File file(IConstructor constructor, String file)
IConstructor getConstructor()
Object put(Object key, Object value)
ParserMacroSet parserMacros
String getToken(int index)
String getToken(int index, String def)
void prepareProperties(ElephantMarker marker, String properties)
abstract String getParserName()
String getToken(String name)
ParserMacroSet getParserMacros()
String getToken(String name, boolean defParameter)
String getToken(String name, String def)
abstract boolean doExecute()
String getToken(int index, boolean defParameter)
abstract void explainMacros(ParserMacroSet macros)
String getDefaultFor(int index)
boolean execute(IConstructor constructor, PrintWriter out, String[] tokens)