@Test public void testAnnotation() { StringBuilder bldr = new StringBuilder(); bldr.append("SET DOCUMENT Name = \"Name\"\n"); bldr.append("SET DOCUMENT Description = \"Description\"\n"); bldr.append("SET DOCUMENT Version = \"1.0\"\n"); bldr.append("DEFINE ANNOTATION X AS PATTERN "); bldr.append("\"0|1|0?\\\\.[\\\\d]+|1\\\\.[0]+\"\n"); bldr.append("SET STATEMENT_GROUP = \"\u03B2-cell study\"\n"); bldr.append("SET X = \"0.42\"\n"); bldr.append("p(X) -> p(Y)\n"); bldr.append("UNSET STATEMENT_GROUP\n"); String belscript = bldr.toString(); BELParseResults parse = BELParser.parse(belscript); assertTrue(parse.getSyntaxWarnings().isEmpty()); assertTrue(parse.getSyntaxErrors().isEmpty()); BELDocument doc = parse.getDocument(); assertNotNull(doc); List<BELStatementGroup> groups = doc.getBelStatementGroups(); BELStatementGroup group = groups.get(0); List<BELStatement> stmts = group.getStatements(); assertTrue(stmts.size() == 1); BELStatement stmt = stmts.get(0); List<BELAnnotation> annos = stmt.getAnnotations(); assertTrue(annos.size() == 1); BELAnnotation anno = annos.get(0); assertTrue(anno.getValues().size() == 1); assertTrue("0.42".equals(anno.getValues().get(0))); }
public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; }
BELScriptParser extends Parser { public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; } }
BELScriptParser extends Parser { public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; } BELScriptParser(TokenStream input);  BELScriptParser(TokenStream input, RecognizerSharedState state); }
BELScriptParser extends Parser { public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; } BELScriptParser(TokenStream input);  BELScriptParser(TokenStream input, RecognizerSharedState state); void setTreeAdaptor(TreeAdaptor adaptor); TreeAdaptor getTreeAdaptor(); String[] getTokenNames(); String getGrammarFileName(); List<BELParseErrorException> getSyntaxErrors(); @Override void emitErrorMessage(String msg); @Override void displayRecognitionError(String[] tokenNames, RecognitionException e); final BELScriptParser.document_return document(); final BELScriptParser.record_return record(); final BELScriptParser.set_document_return set_document(); final BELScriptParser.set_statement_group_return set_statement_group(); final BELScriptParser.set_annotation_return set_annotation(); final BELScriptParser.unset_statement_group_return unset_statement_group(); final BELScriptParser.unset_return unset(); final BELScriptParser.define_namespace_return define_namespace(); final BELScriptParser.define_annotation_return define_annotation(); final BELScriptParser.quoted_value_return quoted_value(); final BELScriptParser.document_property_return document_property(); final BELScriptParser.statement_return statement(); final BELScriptParser.outer_term_return outer_term(); final BELScriptParser.argument_return argument(); final BELScriptParser.term_return term(); final BELScriptParser.param_return param(); final BELScriptParser.function_return function(); final BELScriptParser.relationship_return relationship(); }
BELScriptParser extends Parser { public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; } BELScriptParser(TokenStream input);  BELScriptParser(TokenStream input, RecognizerSharedState state); void setTreeAdaptor(TreeAdaptor adaptor); TreeAdaptor getTreeAdaptor(); String[] getTokenNames(); String getGrammarFileName(); List<BELParseErrorException> getSyntaxErrors(); @Override void emitErrorMessage(String msg); @Override void displayRecognitionError(String[] tokenNames, RecognitionException e); final BELScriptParser.document_return document(); final BELScriptParser.record_return record(); final BELScriptParser.set_document_return set_document(); final BELScriptParser.set_statement_group_return set_statement_group(); final BELScriptParser.set_annotation_return set_annotation(); final BELScriptParser.unset_statement_group_return unset_statement_group(); final BELScriptParser.unset_return unset(); final BELScriptParser.define_namespace_return define_namespace(); final BELScriptParser.define_annotation_return define_annotation(); final BELScriptParser.quoted_value_return quoted_value(); final BELScriptParser.document_property_return document_property(); final BELScriptParser.statement_return statement(); final BELScriptParser.outer_term_return outer_term(); final BELScriptParser.argument_return argument(); final BELScriptParser.term_return term(); final BELScriptParser.param_return param(); final BELScriptParser.function_return function(); final BELScriptParser.relationship_return relationship(); static final String[] tokenNames; static final int EOF; static final int T__24; static final int T__25; static final int T__26; static final int T__27; static final int T__28; static final int T__29; static final int T__30; static final int T__31; static final int T__32; static final int T__33; static final int T__34; static final int T__35; static final int T__36; static final int T__37; static final int T__38; static final int T__39; static final int T__40; static final int T__41; static final int T__42; static final int T__43; static final int T__44; static final int T__45; static final int T__46; static final int T__47; static final int T__48; static final int T__49; static final int T__50; static final int T__51; static final int T__52; static final int T__53; static final int T__54; static final int T__55; static final int T__56; static final int T__57; static final int T__58; static final int T__59; static final int T__60; static final int T__61; static final int T__62; static final int T__63; static final int T__64; static final int T__65; static final int T__66; static final int T__67; static final int T__68; static final int T__69; static final int T__70; static final int T__71; static final int T__72; static final int T__73; static final int T__74; static final int T__75; static final int T__76; static final int T__77; static final int T__78; static final int T__79; static final int T__80; static final int T__81; static final int T__82; static final int T__83; static final int T__84; static final int T__85; static final int T__86; static final int T__87; static final int T__88; static final int T__89; static final int T__90; static final int T__91; static final int T__92; static final int T__93; static final int T__94; static final int T__95; static final int T__96; static final int T__97; static final int T__98; static final int T__99; static final int T__100; static final int T__101; static final int T__102; static final int T__103; static final int T__104; static final int T__105; static final int T__106; static final int T__107; static final int T__108; static final int T__109; static final int T__110; static final int T__111; static final int T__112; static final int T__113; static final int T__114; static final int T__115; static final int T__116; static final int T__117; static final int T__118; static final int T__119; static final int T__120; static final int T__121; static final int T__122; static final int T__123; static final int T__124; static final int T__125; static final int T__126; static final int T__127; static final int T__128; static final int T__129; static final int T__130; static final int NEWLINE; static final int DOCUMENT_COMMENT; static final int DOCUMENT_KEYWORD; static final int OBJECT_IDENT; static final int VALUE_LIST; static final int STATEMENT_GROUP_KEYWORD; static final int IDENT_LIST; static final int QUOTED_VALUE; static final int OPEN_PAREN; static final int CLOSE_PAREN; static final int STATEMENT_COMMENT; static final int NS_PREFIX; static final int COMMA; static final int LETTER; static final int DIGIT; static final int EscapeSequence; static final int WS; static final int UnicodeEscape; static final int OctalEscape; static final int HexDigit; static final BitSet FOLLOW_NEWLINE_in_document62; static final BitSet FOLLOW_DOCUMENT_COMMENT_in_document66; static final BitSet FOLLOW_record_in_document70; static final BitSet FOLLOW_EOF_in_document74; static final BitSet FOLLOW_define_namespace_in_record91; static final BitSet FOLLOW_define_annotation_in_record95; static final BitSet FOLLOW_set_annotation_in_record99; static final BitSet FOLLOW_set_document_in_record103; static final BitSet FOLLOW_set_statement_group_in_record107; static final BitSet FOLLOW_unset_statement_group_in_record111; static final BitSet FOLLOW_unset_in_record115; static final BitSet FOLLOW_statement_in_record119; static final BitSet FOLLOW_24_in_set_document160; static final BitSet FOLLOW_DOCUMENT_KEYWORD_in_set_document162; static final BitSet FOLLOW_document_property_in_set_document165; static final BitSet FOLLOW_25_in_set_document167; static final BitSet FOLLOW_OBJECT_IDENT_in_set_document170; static final BitSet FOLLOW_VALUE_LIST_in_set_document176; static final BitSet FOLLOW_quoted_value_in_set_document180; static final BitSet FOLLOW_24_in_set_statement_group226; static final BitSet FOLLOW_STATEMENT_GROUP_KEYWORD_in_set_statement_group228; static final BitSet FOLLOW_25_in_set_statement_group230; static final BitSet FOLLOW_quoted_value_in_set_statement_group233; static final BitSet FOLLOW_OBJECT_IDENT_in_set_statement_group237; static final BitSet FOLLOW_24_in_set_annotation277; static final BitSet FOLLOW_OBJECT_IDENT_in_set_annotation279; static final BitSet FOLLOW_25_in_set_annotation281; static final BitSet FOLLOW_quoted_value_in_set_annotation284; static final BitSet FOLLOW_VALUE_LIST_in_set_annotation290; static final BitSet FOLLOW_OBJECT_IDENT_in_set_annotation294; static final BitSet FOLLOW_26_in_unset_statement_group340; static final BitSet FOLLOW_STATEMENT_GROUP_KEYWORD_in_unset_statement_group342; static final BitSet FOLLOW_26_in_unset381; static final BitSet FOLLOW_set_in_unset383; static final BitSet FOLLOW_27_in_define_namespace429; static final BitSet FOLLOW_28_in_define_namespace433; static final BitSet FOLLOW_29_in_define_namespace437; static final BitSet FOLLOW_OBJECT_IDENT_in_define_namespace441; static final BitSet FOLLOW_30_in_define_namespace443; static final BitSet FOLLOW_31_in_define_namespace445; static final BitSet FOLLOW_quoted_value_in_define_namespace447; static final BitSet FOLLOW_27_in_define_annotation487; static final BitSet FOLLOW_32_in_define_annotation489; static final BitSet FOLLOW_OBJECT_IDENT_in_define_annotation492; static final BitSet FOLLOW_30_in_define_annotation494; static final BitSet FOLLOW_set_in_define_annotation498; static final BitSet FOLLOW_quoted_value_in_define_annotation506; static final BitSet FOLLOW_34_in_define_annotation512; static final BitSet FOLLOW_VALUE_LIST_in_define_annotation516; static final BitSet FOLLOW_QUOTED_VALUE_in_quoted_value543; static final BitSet FOLLOW_set_in_document_property0; static final BitSet FOLLOW_outer_term_in_statement677; static final BitSet FOLLOW_relationship_in_statement680; static final BitSet FOLLOW_OPEN_PAREN_in_statement684; static final BitSet FOLLOW_outer_term_in_statement686; static final BitSet FOLLOW_relationship_in_statement688; static final BitSet FOLLOW_outer_term_in_statement690; static final BitSet FOLLOW_CLOSE_PAREN_in_statement692; static final BitSet FOLLOW_outer_term_in_statement697; static final BitSet FOLLOW_STATEMENT_COMMENT_in_statement702; static final BitSet FOLLOW_function_in_outer_term723; static final BitSet FOLLOW_OPEN_PAREN_in_outer_term725; static final BitSet FOLLOW_43_in_outer_term728; static final BitSet FOLLOW_argument_in_outer_term731; static final BitSet FOLLOW_CLOSE_PAREN_in_outer_term735; static final BitSet FOLLOW_param_in_argument755; static final BitSet FOLLOW_term_in_argument759; static final BitSet FOLLOW_function_in_term775; static final BitSet FOLLOW_OPEN_PAREN_in_term777; static final BitSet FOLLOW_43_in_term780; static final BitSet FOLLOW_term_in_term784; static final BitSet FOLLOW_param_in_term788; static final BitSet FOLLOW_CLOSE_PAREN_in_term793; static final BitSet FOLLOW_NS_PREFIX_in_param813; static final BitSet FOLLOW_OBJECT_IDENT_in_param817; static final BitSet FOLLOW_quoted_value_in_param821; static final BitSet FOLLOW_44_in_function854; static final BitSet FOLLOW_45_in_function880; static final BitSet FOLLOW_46_in_function921; static final BitSet FOLLOW_47_in_function952; static final BitSet FOLLOW_48_in_function993; static final BitSet FOLLOW_49_in_function1027; static final BitSet FOLLOW_50_in_function1068; static final BitSet FOLLOW_51_in_function1094; static final BitSet FOLLOW_52_in_function1135; static final BitSet FOLLOW_53_in_function1164; static final BitSet FOLLOW_54_in_function1205; static final BitSet FOLLOW_55_in_function1231; static final BitSet FOLLOW_56_in_function1271; static final BitSet FOLLOW_57_in_function1304; static final BitSet FOLLOW_58_in_function1342; static final BitSet FOLLOW_59_in_function1369; static final BitSet FOLLOW_60_in_function1404; static final BitSet FOLLOW_61_in_function1434; static final BitSet FOLLOW_62_in_function1472; static final BitSet FOLLOW_63_in_function1502; static final BitSet FOLLOW_64_in_function1541; static final BitSet FOLLOW_65_in_function1562; static final BitSet FOLLOW_66_in_function1600; static final BitSet FOLLOW_67_in_function1634; static final BitSet FOLLOW_68_in_function1673; static final BitSet FOLLOW_69_in_function1697; static final BitSet FOLLOW_70_in_function1730; static final BitSet FOLLOW_71_in_function1766; static final BitSet FOLLOW_72_in_function1805; static final BitSet FOLLOW_73_in_function1836; static final BitSet FOLLOW_74_in_function1875; static final BitSet FOLLOW_75_in_function1900; static final BitSet FOLLOW_76_in_function1939; static final BitSet FOLLOW_77_in_function1964; static final BitSet FOLLOW_78_in_function2003; static final BitSet FOLLOW_79_in_function2031; static final BitSet FOLLOW_80_in_function2070; static final BitSet FOLLOW_81_in_function2093; static final BitSet FOLLOW_82_in_function2131; static final BitSet FOLLOW_83_in_function2156; static final BitSet FOLLOW_84_in_function2195; static final BitSet FOLLOW_85_in_function2217; static final BitSet FOLLOW_86_in_function2255; static final BitSet FOLLOW_87_in_function2274; static final BitSet FOLLOW_88_in_function2309; static final BitSet FOLLOW_89_in_function2334; static final BitSet FOLLOW_90_in_function2371; static final BitSet FOLLOW_91_in_function2397; static final BitSet FOLLOW_92_in_function2436; static final BitSet FOLLOW_93_in_function2461; static final BitSet FOLLOW_94_in_function2499; static final BitSet FOLLOW_95_in_function2522; static final BitSet FOLLOW_96_in_function2560; static final BitSet FOLLOW_97_in_function2590; static final BitSet FOLLOW_98_in_function2629; static final BitSet FOLLOW_99_in_function2661; static final BitSet FOLLOW_100_in_function2698; static final BitSet FOLLOW_101_in_function2731; static final BitSet FOLLOW_102_in_function2765; static final BitSet FOLLOW_103_in_relationship2831; static final BitSet FOLLOW_104_in_relationship2865; static final BitSet FOLLOW_105_in_relationship2905; static final BitSet FOLLOW_106_in_relationship2939; static final BitSet FOLLOW_107_in_relationship2979; static final BitSet FOLLOW_108_in_relationship3004; static final BitSet FOLLOW_109_in_relationship3044; static final BitSet FOLLOW_110_in_relationship3069; static final BitSet FOLLOW_111_in_relationship3109; static final BitSet FOLLOW_112_in_relationship3137; static final BitSet FOLLOW_113_in_relationship3160; static final BitSet FOLLOW_114_in_relationship3183; static final BitSet FOLLOW_115_in_relationship3213; static final BitSet FOLLOW_116_in_relationship3253; static final BitSet FOLLOW_117_in_relationship3282; static final BitSet FOLLOW_118_in_relationship3322; static final BitSet FOLLOW_119_in_relationship3361; static final BitSet FOLLOW_120_in_relationship3391; static final BitSet FOLLOW_121_in_relationship3415; static final BitSet FOLLOW_122_in_relationship3445; static final BitSet FOLLOW_123_in_relationship3465; static final BitSet FOLLOW_124_in_relationship3496; static final BitSet FOLLOW_125_in_relationship3529; static final BitSet FOLLOW_126_in_relationship3560; static final BitSet FOLLOW_127_in_relationship3600; static final BitSet FOLLOW_128_in_relationship3632; static final BitSet FOLLOW_129_in_relationship3661; static final BitSet FOLLOW_130_in_relationship3694; }