KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jicengine > expression > Parser


1 package org.jicengine.expression;
2
3 import org.jicengine.operation.Operation;
4
5 /**
6  * for parsing string expressions into executable
7  * operations.
8  *
9  * <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 JavaDoc(".").charAt(0);
20     public static char METHOD_PARAMS_START = new String JavaDoc("(").charAt(0);
21     public static char METHOD_PARAMS_END = new String JavaDoc(")").charAt(0);
22     public static char ARRAY_LENGTH_START = new String JavaDoc("[").charAt(0);
23     public static char ARRAY_LENGTH_END = new String JavaDoc("]").charAt(0);
24
25     public static String JavaDoc BOOLEAN_TRUE = new String JavaDoc("true");
26     public static String JavaDoc BOOLEAN_FALSE = new String JavaDoc("false");
27     public static char STRING_MARKER = new String JavaDoc("'").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 JavaDoc expression) throws SyntaxException;
39
40 }
41
Popular Tags