01: package org.jicengine.expression;
02:
03: import org.jicengine.operation.Operation;
04:
05: /**
06: * for parsing string expressions into executable
07: * operations.
08: *
09: * <p>
10: * Copyright (C) 2004 Timo Laitinen
11: * </p>
12: * @author Timo Laitinen
13: * @created 2004-09-20
14: * @since JICE-0.10
15: */
16:
17: public interface Parser {
18:
19: public static char OPERATION_SEPARATOR = new String(".").charAt(0);
20: public static char METHOD_PARAMS_START = new String("(").charAt(0);
21: public static char METHOD_PARAMS_END = new String(")").charAt(0);
22: public static char ARRAY_LENGTH_START = new String("[").charAt(0);
23: public static char ARRAY_LENGTH_END = new String("]").charAt(0);
24:
25: public static String BOOLEAN_TRUE = new String("true");
26: public static String BOOLEAN_FALSE = new String("false");
27: public static char STRING_MARKER = new String("'").charAt(0);
28:
29: /**
30: * @return Parsers may return null in order to signal 'abort' i.e.
31: * if the syntax of the expression is not understood by
32: * the parser implementation. i.e. NumberParser returns null
33: * if the expression is a string-expression..
34: *
35: * @throws ExpressionException if the syntax of the expression looked
36: * like okay, but the parsing failed for some reason.
37: */
38: public Operation parse(String expression) throws SyntaxException;
39:
40: }
|