src/org/ohmage/config/grammar/custom/ConditionValidator.java
@SuppressWarnings("static-access")
	public static Map<String, List<ConditionValuePair>> validate(String conditionSentence) {
		Start s = null;
		
		try {
			
			// TODO - fix the ConditionParser instantiation logic by rebuilding the parser and setting the JavaCC parameter STATIC
			// to false. Without the false setting, the weird ReInit logic below must occur.
			
			if(first) {
				
				first = false;
				s = new ConditionParser(new StringReader(conditionSentence)).start();
				
			} else {
				ConditionParser.ReInit(new StringReader(conditionSentence)); // ReInit must be called for a multiple parse scenario
				                                                             // i.e., when this method is called from a loop
				s = ConditionParser.start();
			}
			
			ConditionDepthFirst<Map<String, List<ConditionValuePair>>> visitor 
				= new ConditionDepthFirst<Map<String, List<ConditionValuePair>>>();
			Map<String, List<ConditionValuePair>>map = new HashMap<String, List<ConditionValuePair>>(); 
			visitor.visit(s, map);
			return map;
			
		} catch (ParseException pe) {
			
			throw new ConditionParseException("Condition parse failed for Condition Sentence: " + conditionSentence, pe);
		}
		catch(Throwable e) {
			throw new ConditionParseException("The Condition Sentence is not well-formed: " + conditionSentence, e);
		}
	}
/**
	 * Validates the provided Condition Sentence.
	 * 
	 * @param conditionSentence
	 * @return Map of Id-Value list pairs for each Id-operation-Value in the provided Sentence
	 * @throws ConditionParseException if the Sentence does not conform to our grammar (see spec/Condition-grammar.jj) 
	 */
Validates the provided Condition Sentence.

@param conditionSentence
@return Map of Id-Value list pairs for each Id-operation-Value in the provided Sentence
@throws ConditionParseException if the Sentence does not conform to our grammar
Validates the provided Condition Sentence . @param conditionSentence @return Map of Id - Value list pairs for each Id - operation - Value in the provided Sentence @throws ConditionParseException if the Sentence does not conform to our grammar
@SuppressWarnings("static-access")
	public static Map<String, List<ConditionValuePair>> validate(String conditionSentence) {
		Start s = null;
		try {
			if(first) {
				first = false;
				s = new ConditionParser(new StringReader(conditionSentence)).start();
			} else {
				ConditionParser.ReInit(new StringReader(conditionSentence)); 
				s = ConditionParser.start();
			}
			ConditionDepthFirst<Map<String, List<ConditionValuePair>>> visitor 
				= new ConditionDepthFirst<Map<String, List<ConditionValuePair>>>();
			Map<String, List<ConditionValuePair>>map = new HashMap<String, List<ConditionValuePair>>(); 
			visitor.visit(s, map);
			return map;
		} catch (ParseException pe) {
			throw new ConditionParseException("Condition parse failed for Condition Sentence: " + conditionSentence, pe);
		}
		catch(Throwable e) {
			throw new ConditionParseException("The Condition Sentence is not well-formed: " + conditionSentence, e);
		}
	}
@ SuppressWarnings ( "static-access" ) public static Map < String , List < ConditionValuePair > > validate ( String conditionSentence ) { Start s = null ; try { if ( first ) { first = false ; s = new ConditionParser ( new StringReader ( conditionSentence ) ) . start ( ) ; } else { ConditionParser . ReInit ( new StringReader ( conditionSentence ) ) ; s = ConditionParser . start ( ) ; } ConditionDepthFirst < Map < String , List < ConditionValuePair > > > visitor = new ConditionDepthFirst < Map < String , List < ConditionValuePair > > > ( ) ; Map < String , List < ConditionValuePair > > map = new HashMap < String , List < ConditionValuePair > > ( ) ; visitor . visit ( s , map ) ; return map ; } catch ( ParseException pe ) { throw new ConditionParseException ( "Condition parse failed for Condition Sentence: " + conditionSentence , pe ) ; } catch ( Throwable e ) { throw new ConditionParseException ( "The Condition Sentence is not well-formed: " + conditionSentence , e ) ; } }
Validates the provided Condition Sentence.
Validates the provided Condition Sentence .
// TODO - fix the ConditionParser instantiation logic by rebuilding the parser and setting the JavaCC parameter STATIC // to false. Without the false setting, the weird ReInit logic below must occur. // ReInit must be called for a multiple parse scenario // i.e., when this method is called from a loop