@@ -530,11 +530,11 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
530
530
Token value = null ;
531
531
Token attrType = null ;
532
532
switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
533
- case ALIGNRELN :
534
533
case IDENTIFIER :{
534
+ attr = jj_consume_token (IDENTIFIER );
535
535
switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
536
- case IDENTIFIER :{
537
- attr = jj_consume_token ( IDENTIFIER );
536
+ case 10 :
537
+ case 22 :{
538
538
switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
539
539
case 10 :{
540
540
attrType = jj_consume_token (10 );
@@ -563,6 +563,10 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
563
563
jj_consume_token (-1 );
564
564
throw new ParseException ();
565
565
}
566
+ if (attr != null && value != null ) {
567
+ boolean negated = attrType .image .equals ("!:" );
568
+ attributes .setAttribute (attr .image , value .image , negated );
569
+ }
566
570
break ;
567
571
}
568
572
case ALIGNRELN :{
@@ -583,23 +587,20 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
583
587
jj_consume_token (-1 );
584
588
throw new ParseException ();
585
589
}
590
+ if (attrType .image .equals ("@" )) {
591
+ if (attr == null || key == null || value == null ) {
592
+ {if (true ) throw new SemgrexParseException ("null while parsing semgrex expression: attr=" + attr +
593
+ " key=" + key + " value=" + value );}
594
+ }
595
+ attributes .addContains (attr .image , key .image , value .image );
596
+ }
586
597
break ;
587
598
}
588
599
default :
589
600
jj_la1 [26 ] = jj_gen ;
590
601
jj_consume_token (-1 );
591
602
throw new ParseException ();
592
603
}
593
- if (attrType .image .equals ("@" )) {
594
- if (attr == null || key == null || value == null ) {
595
- {if (true ) throw new SemgrexParseException ("null while parsing semgrex expression: attr=" + attr +
596
- " key=" + key + " value=" + value );}
597
- }
598
- attributes .addContains (attr .image , key .image , value .image );
599
- } else if (attr != null && value != null ) {
600
- boolean negated = attrType .image .equals ("!:" );
601
- attributes .setAttribute (attr .image , value .image , negated );
602
- }
603
604
break ;
604
605
}
605
606
case ROOT :{
@@ -625,7 +626,6 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
625
626
NodePattern pat ;
626
627
jj_consume_token (23 );
627
628
switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
628
- case ALIGNRELN :
629
629
case IDENTIFIER :
630
630
case EMPTY :
631
631
case ROOT :{
@@ -690,7 +690,7 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
690
690
jj_la1_init_0 ();
691
691
}
692
692
private static void jj_la1_init_0 () {
693
- jj_la1_0 = new int [] {0x400 ,0x828808 ,0x3801c ,0x3801c ,0x828800 ,0x2000 ,0x3c01c ,0x4000 ,0x3801c ,0x2001c ,0x80000 ,0x10 ,0x110 ,0x110 ,0x100000 ,0x200000 ,0x1c ,0x828800 ,0x2000 ,0x82c000 ,0x4000 ,0x828000 ,0x820000 ,0x400400 ,0x110 ,0x110 ,0x18 , 0xd8 ,0x1000000 ,0xd8 ,0x200000 ,};
693
+ jj_la1_0 = new int [] {0x400 ,0x828808 ,0x3801c ,0x3801c ,0x828800 ,0x2000 ,0x3c01c ,0x4000 ,0x3801c ,0x2001c ,0x80000 ,0x10 ,0x110 ,0x110 ,0x100000 ,0x200000 ,0x1c ,0x828800 ,0x2000 ,0x82c000 ,0x4000 ,0x828000 ,0x820000 ,0x400400 ,0x110 ,0x110 ,0x400408 , 0xd0 ,0x1000000 ,0xd0 ,0x200000 ,};
694
694
}
695
695
696
696
/** Constructor with InputStream. */
0 commit comments