All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.ripe.db.whois.common.generated.ImportViaParser Maven / Gradle / Ivy

//### This file created by BYACC 1.8(/Java extension  1.15)
//### Java capabilities added 7 Jan 97, Bob Jamison
//### Updated : 27 Nov 97  -- Bob Jamison, Joe Nieten
//###           01 Jan 98  -- Bob Jamison -- fixed generic semantic constructor
//###           01 Jun 99  -- Bob Jamison -- added Runnable support
//###           06 Aug 00  -- Bob Jamison -- made state variables class-global
//###           03 Jan 01  -- Bob Jamison -- improved flags, tracing
//###           16 May 01  -- Bob Jamison -- added custom stack sizing
//###           04 Mar 02  -- Yuval Oren  -- improved java performance, added options
//###           14 Mar 02  -- Tomas Hurka -- -d support, static initializer workaround
//### Please send bug reports to [email protected]
//### static char yysccsid[] = "@(#)yaccpar	1.8 (Berkeley) 01/20/90";



package net.ripe.db.whois.common.generated;



//#line 2 "src/main/parser/byacc/import_via.y"
import net.ripe.db.whois.common.rpsl.AttributeParser;
import net.ripe.db.whois.common.rpsl.ParserHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.StringReader;
/*
  filename: import_via.y

  description:
    Defines the grammar for an import-via attribute. Derived from
    mp_import.y.

  notes:
    Defines tokens for the associated lexer, import_via.l.
*/
//#line 35 "ImportViaParser.java"




public class ImportViaParser
             implements AttributeParser
{

boolean yydebug;        //do I want debug output?
int yynerrs;            //number of errors so far
int yyerrflag;          //was there an error?
int yychar;             //the current working character

//########## MESSAGES ##########
//###############################################################
// method: debug
//###############################################################
void debug(String msg)
{
  if (yydebug)
    System.out.println(msg);
}

//########## STATE STACK ##########
final static int YYSTACKSIZE = 500;  //maximum stack size
int statestk[] = new int[YYSTACKSIZE]; //state stack
int stateptr;
int stateptrmax;                     //highest index of stackptr
int statemax;                        //state when highest index reached
//###############################################################
// methods: state stack push,pop,drop,peek
//###############################################################
final void state_push(int state)
{
  try {
		stateptr++;
		statestk[stateptr]=state;
	 }
	 catch (ArrayIndexOutOfBoundsException e) {
     int oldsize = statestk.length;
     int newsize = oldsize * 2;
     int[] newstack = new int[newsize];
     System.arraycopy(statestk,0,newstack,0,oldsize);
     statestk = newstack;
     statestk[stateptr]=state;
  }
}
final int state_pop()
{
  return statestk[stateptr--];
}
final void state_drop(int cnt)
{
  stateptr -= cnt; 
}
final int state_peek(int relative)
{
  return statestk[stateptr-relative];
}
//###############################################################
// method: init_stacks : allocate and prepare stacks
//###############################################################
final boolean init_stacks()
{
  stateptr = -1;
  val_init();
  return true;
}
//###############################################################
// method: dump_stacks : show n levels of the stacks
//###############################################################
void dump_stacks(int count)
{
int i;
  System.out.println("=index==state====value=     s:"+stateptr+"  v:"+valptr);
  for (i=0;i=YYSTACKSIZE)
    return;
  valstk[++valptr]=val;
}
ImportViaParserVal val_pop()
{
  if (valptr<0)
    return new ImportViaParserVal();
  return valstk[valptr--];
}
void val_drop(int cnt)
{
int ptr;
  ptr=valptr-cnt;
  if (ptr<0)
    return;
  valptr = ptr;
}
ImportViaParserVal val_peek(int relative)
{
int ptr;
  ptr=valptr-relative;
  if (ptr<0)
    return new ImportViaParserVal();
  return valstk[ptr];
}
final ImportViaParserVal dup_yyval(ImportViaParserVal val)
{
  ImportViaParserVal dup = new ImportViaParserVal();
  dup.ival = val.ival;
  dup.dval = val.dval;
  dup.sval = val.sval;
  dup.obj = val.obj;
  return dup;
}
//#### end semantic value section ####
public final static short OP_OR=257;
public final static short OP_AND=258;
public final static short OP_NOT=259;
public final static short OP_MS=260;
public final static short OP_EQUAL=261;
public final static short OP_APPEND=262;
public final static short OP_COMPARE=263;
public final static short KEYW_ANY=264;
public final static short KEYW_PEERAS=265;
public final static short ASPATH_POSTFIX=266;
public final static short TKN_FLTRNAME=267;
public final static short TKN_ASNO=268;
public final static short TKN_ASRANGE=269;
public final static short TKN_RSNAME=270;
public final static short TKN_ASNAME=271;
public final static short TKN_PRFXV4=272;
public final static short TKN_PRFXV4RNG=273;
public final static short TKN_IPV4=274;
public final static short TKN_DNS=275;
public final static short TKN_RTRSNAME=276;
public final static short TKN_PRNGNAME=277;
public final static short TKN_IPV6=278;
public final static short TKN_IPV6DC=279;
public final static short TKN_PRFXV6=280;
public final static short TKN_PRFXV6DC=281;
public final static short TKN_PRFXV6RNG=282;
public final static short TKN_PRFXV6DCRNG=283;
public final static short KEYW_ACTION=284;
public final static short KEYW_EXCEPT=285;
public final static short KEYW_AFI=286;
public final static short KEYW_AFI_VALUE_V4=287;
public final static short KEYW_AFI_VALUE_V6=288;
public final static short KEYW_AFI_VALUE_ANY=289;
public final static short TKN_PREF=290;
public final static short TKN_MED=291;
public final static short TKN_DPA=292;
public final static short TKN_ASPATH=293;
public final static short TKN_COMMUNITY=294;
public final static short TKN_NEXT_HOP=295;
public final static short TKN_COST=296;
public final static short TKN_COMM_NO=297;
public final static short KEYW_IGP_COST=298;
public final static short KEYW_SELF=299;
public final static short KEYW_PREPEND=300;
public final static short KEYW_APPEND=301;
public final static short KEYW_DELETE=302;
public final static short KEYW_CONTAINS=303;
public final static short KEYW_AT=304;
public final static short KEYW_INTERNET=305;
public final static short KEYW_NO_EXPORT=306;
public final static short KEYW_NO_ADVERTISE=307;
public final static short KEYW_PROTOCOL=308;
public final static short TKN_PROTOCOL=309;
public final static short KEYW_INTO=310;
public final static short KEYW_REFINE=311;
public final static short KEYW_ACCEPT=312;
public final static short KEYW_FROM=313;
public final static short TKN_INT=314;
public final static short YYERRCODE=256;
final static short yylhs[] = {                           -1,
    0,    0,    0,    2,    2,    3,    3,    4,    4,    6,
    6,    6,    7,    7,    7,    7,    7,    7,    7,    7,
    8,    8,    5,    5,   10,   10,    9,   11,   11,   13,
   13,   14,   14,   15,   15,   19,   19,   19,   20,   20,
   21,   21,   16,   16,   17,   17,   22,   22,   23,   23,
   23,   24,   24,   25,   25,   25,   25,   25,    1,    1,
   18,   18,   26,   26,   26,   26,   26,   26,   26,   27,
   28,   28,   29,   30,   34,   34,   31,   31,   31,   31,
   31,   31,   31,   35,   36,   36,   37,   37,   37,   37,
   37,   32,   32,   32,   32,   33,   12,   12,   12,   38,
   38,   39,   39,   39,   40,   40,   40,   40,   40,   42,
   42,   43,   43,   43,   43,   43,   44,   44,   45,   45,
   46,   46,   46,   46,   46,   46,   41,   41,   47,   47,
   48,   48,   48,   48,   48,   49,   49,   49,   49,   50,
   50,   50,   50,   50,   50,   51,   51,   51,   51,   51,
   51,   51,
};
final static short yylen[] = {                            2,
    3,    3,    4,    0,    2,    0,    2,    1,    3,    1,
    3,    3,    3,    3,    3,    3,    1,    1,    1,    1,
    2,    3,    1,    3,    2,    3,    3,    4,    5,    3,
    1,    0,    2,    3,    1,    3,    3,    1,    3,    1,
    1,    1,    0,    1,    0,    2,    3,    1,    3,    3,
    1,    3,    1,    1,    1,    1,    1,    1,    1,    3,
    2,    3,    1,    1,    1,    1,    1,    1,    1,    3,
    3,    3,    3,    6,    1,    3,    3,    3,    6,    6,
    6,    4,    3,    3,    1,    3,    1,    1,    1,    1,
    1,    3,    3,    3,    3,    3,    3,    2,    1,    3,
    1,    2,    3,    1,    1,    3,    1,    1,    1,    2,
    1,    1,    1,    1,    1,    3,    0,    1,    1,    3,
    1,    1,    1,    1,    1,    1,    3,    1,    2,    1,
    2,    2,    2,    2,    1,    1,    1,    3,    1,    1,
    1,    1,    1,    3,    4,    0,    2,    2,    2,    4,
    2,    2,
};
final static short yydefred[] = {                         0,
    0,    0,    0,    5,    0,    0,    7,   41,   42,   31,
    0,    0,    0,    1,    0,    8,    0,    0,    0,    0,
    0,    0,   38,   40,   20,   17,   18,   19,    0,    0,
    0,    0,    3,    0,    0,   21,    0,    0,    0,    0,
   54,   59,   58,   55,   56,    0,    0,    0,    0,    0,
   51,   53,    0,    0,    0,    9,    0,   25,   22,    0,
   39,    0,   12,    0,   11,    0,  105,  113,  108,  112,
  115,  114,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  107,   63,   64,   65,   66,   67,   68,
   69,    0,  101,  104,  109,    0,    0,    0,    0,    0,
    0,    0,   30,    0,    0,    0,   36,   37,   16,   13,
   14,   15,   26,    0,  102,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,  121,  124,  122,  123,
  125,  126,    0,    0,  119,    0,  141,  140,  142,    0,
  143,  136,  137,    0,    0,    0,    0,  135,  139,    0,
    0,    0,  110,    0,    0,   28,   52,   60,    0,    0,
   49,   50,   70,   72,   71,   73,    0,    0,   77,   78,
   83,   91,   87,   88,   89,   90,    0,   85,    0,    0,
    0,   92,   93,   94,   95,   96,  116,    0,  103,    0,
  146,    0,  106,    0,    0,  134,  131,  132,  133,    0,
  100,   29,    0,    0,    0,    0,    0,   82,    0,    0,
    0,  120,  138,    0,  148,    0,  151,  152,  149,  144,
    0,    0,   61,   75,    0,   84,   86,    0,    0,    0,
  145,    0,   62,    0,   74,   79,   80,   81,  150,   76,
};
final static short yydgoto[] = {                          2,
   47,    3,    6,   14,   15,   16,   29,   17,   64,   31,
   19,   83,   20,  156,   21,   48,  103,  203,   22,   23,
   24,   49,   50,   51,   52,   84,   85,   86,   87,   88,
   89,   90,   91,  225,  169,  177,  178,   92,   93,   94,
  145,   95,   96,  133,  134,  135,  146,  147,  148,  149,
  192,
};
final static short yysindex[] = {                      -274,
 -273,    0, -272,    0, -261,  191,    0,    0,    0,    0,
 -218,  207,   -7,    0,    8,    0, -246,   13,  -38, -254,
  177, -234,    0,    0,    0,    0,    0,    0,  -15,   18,
  236,  -41,    0,  211,  211,    0,  349, -217,  207,   -7,
    0,    0,    0,    0,    0,  195,    6, -202, -153, -230,
    0,    0,   -7,   -7, -182,    0,   13,    0,    0,   66,
    0, -218,    0,   13,    0,  349,    0,    0,    0,    0,
    0,    0, -123, -116, -115,  101,   38, -112, -109, -122,
  349,  418,  279,    0,    0,    0,    0,    0,    0,    0,
    0, -105,    0,    0,    0,  -98,  207, -121, -234,  -37,
 -110,  195,    0,  195,  195,  195,    0,    0,    0,    0,
    0,    0,    0,  -15,    0, -146, -267, -145, -130,   48,
   48,   48, -170, -192, -225, -142,    0,    0,    0,    0,
    0,    0,   49,  131,    0,  264,    0,    0,    0,  418,
    0,    0,    0,   84,  -45,  418,  -28,    0,    0,  349,
 -105,  349,    0, -121, -101,    0,    0,    0, -153, -230,
    0,    0,    0,    0,    0,    0,  139, -170,    0,    0,
    0,    0,    0,    0,    0,    0,   -4,    0,  140,  142,
  143,    0,    0,    0,    0,    0,    0, -122,    0,  -29,
    0,  -43,    0,  418,  -28,    0,    0,    0,    0, -105,
    0,    0, -101,  125,  -83,  -25, -170,    0, -170, -170,
 -170,    0,    0,  328,    0,  141,    0,    0,    0,    0,
  418,  128,    0,    0,   45,    0,    0,   75,   82,   90,
    0,  -71,    0,  -69,    0,    0,    0,    0,    0,    0,
};
final static short yyrindex[] = {                        50,
    0,    0,  212,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  198,    0,  200,  201,    0,    0,
 -156,  -34,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,  114,  148,  124,  126,
    0,    0,    0,    0,    0,    0,  202,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,   78,
    0,    0,   22,    0,    0,    0,    0,    0,    0,    0,
    0,   16,    0,    0,    0,    1,    0,  -22,  102,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   79,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  338,    0,  -32,  454,    0,    0,    0,
   58,    0,    0,  -22,    0,    0,    0,    0,  173,  136,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  540,    0,    0,    0,    0,   73,
    0,    0,  -14,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  383,    0,    0,    0,    0,
  -30,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
};
final static short yygindex[] = {                         0,
    0,    0,    0,   10,    0,  -21,  144,    0,   91,    0,
    0,  127,    4,   51,  194,    0,    0,    0,  169,   34,
    0,  -19,  106,   24,    0, -135,    0,    0,    0,    0,
    0,    0,    0,    0,   19, -147,    5,  -70,  -61,    0,
   71,    0,    0,    0,    0,   26,   21, -136,    0,    0,
   27,
};
final static int YYTABLESIZE=811;
static short yytable[];
static { yytable();}
static void yytable(){
yytable = new short[]{                         61,
  111,   13,  219,  157,  115,   35,   35,   56,  128,  195,
  127,  213,  151,  197,  199,   99,  193,   32,  207,  204,
  206,   27,   38,   53,   13,   33,  100,  105,   55,  128,
  164,  127,   13,    1,  198,    4,  208,    5,   34,  207,
  111,  111,   98,   63,   65,   25,  165,    7,  182,  220,
   54,  101,  183,  184,  106,   99,   99,   98,   39,  111,
  111,  228,  229,  230,   35,  151,   33,  222,   26,   27,
   28,   36,   97,  185,   99,   99,   58,  123,  194,  200,
   27,  109,  159,  124,  195,  235,  107,  108,  234,    4,
  201,  128,   56,  127,  194,   97,   18,   98,   98,  226,
  154,  102,   30,  104,  110,  111,  112,   12,  179,  180,
  181,   43,   97,   97,   43,  236,   98,   98,  207,   57,
   43,   60,  237,  111,  113,  207,  172,   43,  161,  162,
  238,   97,   97,  207,  173,  174,  175,  116,   99,  170,
  171,   34,   34,  176,  117,  118,  119,   43,  125,  127,
  128,  126,  152,   57,   57,   43,   43,  129,  130,  131,
  132,  153,  155,   44,  158,   48,   48,  163,  166,  167,
  168,  186,    4,  187,  188,   47,   47,  191,  205,  209,
   98,  210,  211,  223,  224,  232,  233,   45,   73,   74,
   75,   76,   77,   78,   79,   97,  239,    2,  240,   10,
   23,   24,  117,  118,  202,  114,   32,  136,   99,  160,
  190,  227,   46,  212,  221,   40,   46,  214,    0,  104,
    0,  215,   35,    0,  216,  217,    0,  218,    0,    8,
   13,    0,    9,   35,   46,    0,   35,  196,   10,   35,
   35,   35,   35,   35,   35,   32,   13,    0,   32,   35,
   13,    6,    8,   33,   32,    9,   33,  111,  111,  111,
    8,   10,   33,    9,  111,  111,    0,  111,  111,   35,
  111,  111,   99,   37,   99,   13,    0,   35,   35,   99,
   99,    0,   99,   99,    0,   99,   99,    0,    0,   32,
  111,  111,  111,  111,  111,  111,  111,   33,  120,  121,
  122,    0,    0,   81,  189,   99,   99,   99,   99,   99,
   99,   99,    0,   12,   98,    0,   98,    4,   81,    0,
    4,   98,   98,   82,   98,   98,    4,   98,   98,   97,
    0,   97,    0,   12,    6,    4,   97,   97,   82,   97,
   97,    0,   97,   97,    0,    0,    0,   98,   98,   98,
   98,   98,   98,   98,    0,    0,    0,    0,   34,    4,
   59,    0,   97,   97,   97,   97,   97,   97,   97,   34,
   57,   57,   34,  219,    0,   34,   34,   34,   34,   34,
   34,   57,   48,  146,   57,   34,   80,    0,   81,    0,
   57,   44,   47,   48,   44,    0,   48,   57,   57,    0,
   44,   80,   48,   47,    0,   34,   47,   44,   82,   48,
    0,    0,   47,   34,   34,   45,    0,   57,   45,   47,
  231,    0,    0,    0,   45,   57,   57,   44,  147,   48,
  146,   45,    0,   40,    0,   44,   44,   48,   48,   47,
   46,    0,    0,   46,    0,    0,    0,   47,   47,   46,
   41,   42,   43,  143,   44,   45,   46,  140,    8,   45,
   45,    9,    0,  141,    0,    0,    0,   10,   41,   42,
   43,   80,   44,   45,    8,  147,   11,    9,    8,    6,
    0,    9,    6,   10,   46,   46,    0,   10,    6,  130,
    0,    0,    0,  130,  130,    0,   62,    6,    0,  130,
    0,    0,    0,    8,    0,    0,    9,    0,  144,    0,
    0,  142,   10,    0,    0,  130,    0,    0,    0,    0,
  150,    0,   66,    0,    0,    0,    0,   67,   68,    0,
   69,   70,    0,   71,   72,  150,    0,   66,    0,    0,
    0,    0,   67,   68,  130,   69,   70,  130,   71,   72,
    0,    0,    0,   73,   74,   75,   76,   77,   78,   79,
    0,    0,    0,    0,    0,    0,    0,    0,   73,   74,
   75,   76,   77,   78,   79,  129,    0,  130,    0,  129,
  129,    0,    0,    0,    0,  129,    0,    0,    0,    0,
    0,    0,  215,    0,    0,  216,  217,    0,  218,    0,
    0,  129,  146,    0,    0,  146,  146,   66,  146,    0,
    0,    0,   67,   68,    0,   69,   70,    0,   71,   72,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  129,    0,    0,  129,    0,    0,    0,    0,   73,   74,
   75,   76,   77,   78,   79,    0,    0,  147,    0,    0,
  147,  147,    0,  147,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  129,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,  137,    0,    0,  138,    0,    0,  139,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,  130,    0,
    0,  130,    0,    0,  130,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  129,    0,    0,  129,    0,    0,
  129,
};
}
static short yycheck[];
static { yycheck(); }
static void yycheck() {
yycheck = new short[] {                         41,
    0,   40,   46,   41,   66,   40,   41,   29,   41,  146,
   41,   41,   83,   42,   43,    0,   62,   40,   44,  155,
  168,    0,   19,  258,   40,   40,   46,  258,   44,   62,
  298,   62,   40,  308,   63,  309,   41,  310,  285,   44,
   40,   41,   39,   34,   35,  264,  314,  309,  274,   93,
  285,   46,  278,  279,  285,   40,   41,    0,  313,   59,
   60,  209,  210,  211,  311,  136,   59,  203,  287,  288,
  289,   59,    0,  299,   59,   60,   59,   40,  124,  150,
   59,  264,  102,   46,  221,   41,   53,   54,   44,   40,
  152,  124,  114,  124,  124,  313,    6,   40,   41,  125,
   97,  304,   12,  257,  287,  288,  289,  123,  301,  302,
  303,  268,   40,   41,  271,   41,   59,   60,   44,   29,
  277,   31,   41,  123,   59,   44,  297,  284,  105,  106,
   41,   59,   60,   44,  305,  306,  307,  261,  123,  121,
  122,   40,   41,  314,  261,  261,   46,  304,  261,  272,
  273,  261,  258,   40,   41,  312,  313,  280,  281,  282,
  283,  260,  284,   40,  275,   40,   41,  314,  314,  300,
  123,  314,  123,  125,   44,   40,   41,   94,   40,   40,
  123,   40,   40,   59,  268,   45,   59,   40,  290,  291,
  292,  293,  294,  295,  296,  123,  268,    0,  268,    0,
    0,    0,  125,  125,  154,   62,   13,   81,   40,  104,
  140,  207,   40,  188,  194,  257,   40,  191,   -1,  257,
   -1,  265,  257,   -1,  268,  269,   -1,  271,   -1,  268,
   40,   -1,  271,  268,   40,   -1,  271,  266,  277,  274,
  275,  276,  277,  278,  279,  268,   40,   -1,  271,  284,
   40,   40,  268,  268,  277,  271,  271,  257,  258,  259,
  268,  277,  277,  271,  264,  265,   -1,  267,  268,  304,
  270,  271,  257,  312,  259,   40,   -1,  312,  313,  264,
  265,   -1,  267,  268,   -1,  270,  271,   -1,   -1,  312,
  290,  291,  292,  293,  294,  295,  296,  312,  261,  262,
  263,   -1,   -1,   40,   41,  290,  291,  292,  293,  294,
  295,  296,   -1,  123,  257,   -1,  259,  268,   40,   -1,
  271,  264,  265,   60,  267,  268,  277,  270,  271,  257,
   -1,  259,   -1,  123,  123,  286,  264,  265,   60,  267,
  268,   -1,  270,  271,   -1,   -1,   -1,  290,  291,  292,
  293,  294,  295,  296,   -1,   -1,   -1,   -1,  257,  310,
  125,   -1,  290,  291,  292,  293,  294,  295,  296,  268,
  257,  258,  271,   46,   -1,  274,  275,  276,  277,  278,
  279,  268,  257,   46,  271,  284,  123,   -1,   40,   -1,
  277,  268,  257,  268,  271,   -1,  271,  284,  285,   -1,
  277,  123,  277,  268,   -1,  304,  271,  284,   60,  284,
   -1,   -1,  277,  312,  313,  268,   -1,  304,  271,  284,
   93,   -1,   -1,   -1,  277,  312,  313,  304,   46,  304,
   93,  284,   -1,  257,   -1,  312,  313,  312,  313,  304,
  268,   -1,   -1,  271,   -1,   -1,   -1,  312,  313,  277,
  274,  275,  276,   36,  278,  279,  284,   40,  268,  312,
  313,  271,   -1,   46,   -1,   -1,   -1,  277,  274,  275,
  276,  123,  278,  279,  268,   93,  286,  271,  268,  268,
   -1,  271,  271,  277,  312,  313,   -1,  277,  277,   36,
   -1,   -1,   -1,   40,   41,   -1,  286,  286,   -1,   46,
   -1,   -1,   -1,  268,   -1,   -1,  271,   -1,   91,   -1,
   -1,   94,  277,   -1,   -1,   62,   -1,   -1,   -1,   -1,
  257,   -1,  259,   -1,   -1,   -1,   -1,  264,  265,   -1,
  267,  268,   -1,  270,  271,  257,   -1,  259,   -1,   -1,
   -1,   -1,  264,  265,   91,  267,  268,   94,  270,  271,
   -1,   -1,   -1,  290,  291,  292,  293,  294,  295,  296,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  290,  291,
  292,  293,  294,  295,  296,   36,   -1,  124,   -1,   40,
   41,   -1,   -1,   -1,   -1,   46,   -1,   -1,   -1,   -1,
   -1,   -1,  265,   -1,   -1,  268,  269,   -1,  271,   -1,
   -1,   62,  265,   -1,   -1,  268,  269,  259,  271,   -1,
   -1,   -1,  264,  265,   -1,  267,  268,   -1,  270,  271,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   91,   -1,   -1,   94,   -1,   -1,   -1,   -1,  290,  291,
  292,  293,  294,  295,  296,   -1,   -1,  265,   -1,   -1,
  268,  269,   -1,  271,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,  265,   -1,   -1,  268,   -1,   -1,  271,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  265,   -1,
   -1,  268,   -1,   -1,  271,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,  265,   -1,   -1,  268,   -1,   -1,
  271,
};
}
final static short YYFINAL=2;
final static short YYMAXTOKEN=314;
final static String yyname[] = {
"end-of-file",null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,"'$'",null,null,null,"'('","')'","'*'","'+'",
"','","'-'","'.'",null,null,null,null,null,null,null,null,null,null,null,null,
"';'","'<'",null,"'>'","'?'",null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,"'['",null,"']'","'^'",null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,"'{'","'|'","'}'",null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,"OP_OR","OP_AND","OP_NOT","OP_MS",
"OP_EQUAL","OP_APPEND","OP_COMPARE","KEYW_ANY","KEYW_PEERAS","ASPATH_POSTFIX",
"TKN_FLTRNAME","TKN_ASNO","TKN_ASRANGE","TKN_RSNAME","TKN_ASNAME","TKN_PRFXV4",
"TKN_PRFXV4RNG","TKN_IPV4","TKN_DNS","TKN_RTRSNAME","TKN_PRNGNAME","TKN_IPV6",
"TKN_IPV6DC","TKN_PRFXV6","TKN_PRFXV6DC","TKN_PRFXV6RNG","TKN_PRFXV6DCRNG",
"KEYW_ACTION","KEYW_EXCEPT","KEYW_AFI","KEYW_AFI_VALUE_V4","KEYW_AFI_VALUE_V6",
"KEYW_AFI_VALUE_ANY","TKN_PREF","TKN_MED","TKN_DPA","TKN_ASPATH",
"TKN_COMMUNITY","TKN_NEXT_HOP","TKN_COST","TKN_COMM_NO","KEYW_IGP_COST",
"KEYW_SELF","KEYW_PREPEND","KEYW_APPEND","KEYW_DELETE","KEYW_CONTAINS",
"KEYW_AT","KEYW_INTERNET","KEYW_NO_EXPORT","KEYW_NO_ADVERTISE","KEYW_PROTOCOL",
"TKN_PROTOCOL","KEYW_INTO","KEYW_REFINE","KEYW_ACCEPT","KEYW_FROM","TKN_INT",
};
final static String yyrule[] = {
"$accept : import_via_attribute",
"import_via_attribute : opt_protocol_from opt_protocol_into afi_import_expr",
"import_via_attribute : opt_protocol_from opt_protocol_into afi_import_factor",
"import_via_attribute : opt_protocol_from opt_protocol_into afi_import_factor ';'",
"opt_protocol_from :",
"opt_protocol_from : KEYW_PROTOCOL TKN_PROTOCOL",
"opt_protocol_into :",
"opt_protocol_into : KEYW_INTO TKN_PROTOCOL",
"afi_import_expr : import_expr",
"afi_import_expr : KEYW_AFI afi_list import_expr",
"import_expr : import_term",
"import_expr : import_term KEYW_REFINE afi_import_expr",
"import_expr : import_term KEYW_EXCEPT afi_import_expr",
"afi_list : afi_list ',' KEYW_AFI_VALUE_V4",
"afi_list : afi_list ',' KEYW_AFI_VALUE_V6",
"afi_list : afi_list ',' KEYW_AFI_VALUE_ANY",
"afi_list : afi_list ',' KEYW_ANY",
"afi_list : KEYW_AFI_VALUE_V4",
"afi_list : KEYW_AFI_VALUE_V6",
"afi_list : KEYW_AFI_VALUE_ANY",
"afi_list : KEYW_ANY",
"import_term : import_factor ';'",
"import_term : '{' import_factor_list '}'",
"afi_import_factor : import_factor",
"afi_import_factor : KEYW_AFI afi_list import_factor",
"import_factor_list : import_factor ';'",
"import_factor_list : import_factor_list import_factor ';'",
"import_factor : import_peering_action_list KEYW_ACCEPT filter",
"import_peering_action_list : peering KEYW_FROM peering opt_action",
"import_peering_action_list : import_peering_action_list peering KEYW_FROM peering opt_action",
"peering : as_expr opt_router_expr opt_router_expr_with_at",
"peering : TKN_PRNGNAME",
"opt_action :",
"opt_action : KEYW_ACTION action",
"as_expr : as_expr OP_OR as_expr_term",
"as_expr : as_expr_term",
"as_expr_term : as_expr_term OP_AND as_expr_factor",
"as_expr_term : as_expr_term KEYW_EXCEPT as_expr_factor",
"as_expr_term : as_expr_factor",
"as_expr_factor : '(' as_expr ')'",
"as_expr_factor : as_expr_operand",
"as_expr_operand : TKN_ASNO",
"as_expr_operand : TKN_ASNAME",
"opt_router_expr :",
"opt_router_expr : router_expr",
"opt_router_expr_with_at :",
"opt_router_expr_with_at : KEYW_AT router_expr",
"router_expr : router_expr OP_OR router_expr_term",
"router_expr : router_expr_term",
"router_expr_term : router_expr_term OP_AND router_expr_factor",
"router_expr_term : router_expr_term KEYW_EXCEPT router_expr_factor",
"router_expr_term : router_expr_factor",
"router_expr_factor : '(' router_expr ')'",
"router_expr_factor : router_expr_operand",
"router_expr_operand : TKN_IPV4",
"router_expr_operand : TKN_IPV6",
"router_expr_operand : TKN_IPV6DC",
"router_expr_operand : domain_name",
"router_expr_operand : TKN_RTRSNAME",
"domain_name : TKN_DNS",
"domain_name : domain_name '.' TKN_DNS",
"action : rp_attribute ';'",
"action : action rp_attribute ';'",
"rp_attribute : pref",
"rp_attribute : med",
"rp_attribute : dpa",
"rp_attribute : aspath",
"rp_attribute : community",
"rp_attribute : next_hop",
"rp_attribute : cost",
"pref : TKN_PREF OP_EQUAL TKN_INT",
"med : TKN_MED OP_EQUAL TKN_INT",
"med : TKN_MED OP_EQUAL KEYW_IGP_COST",
"dpa : TKN_DPA OP_EQUAL TKN_INT",
"aspath : TKN_ASPATH '.' KEYW_PREPEND '(' asno_list ')'",
"asno_list : TKN_ASNO",
"asno_list : asno_list ',' TKN_ASNO",
"community : TKN_COMMUNITY OP_EQUAL community_list",
"community : TKN_COMMUNITY OP_APPEND community_list",
"community : TKN_COMMUNITY '.' KEYW_APPEND '(' community_elm_list ')'",
"community : TKN_COMMUNITY '.' KEYW_DELETE '(' community_elm_list ')'",
"community : TKN_COMMUNITY '.' KEYW_CONTAINS '(' community_elm_list ')'",
"community : TKN_COMMUNITY '(' community_elm_list ')'",
"community : TKN_COMMUNITY OP_COMPARE community_list",
"community_list : '{' community_elm_list '}'",
"community_elm_list : community_elm",
"community_elm_list : community_elm_list ',' community_elm",
"community_elm : KEYW_INTERNET",
"community_elm : KEYW_NO_EXPORT",
"community_elm : KEYW_NO_ADVERTISE",
"community_elm : TKN_INT",
"community_elm : TKN_COMM_NO",
"next_hop : TKN_NEXT_HOP OP_EQUAL TKN_IPV4",
"next_hop : TKN_NEXT_HOP OP_EQUAL TKN_IPV6",
"next_hop : TKN_NEXT_HOP OP_EQUAL TKN_IPV6DC",
"next_hop : TKN_NEXT_HOP OP_EQUAL KEYW_SELF",
"cost : TKN_COST OP_EQUAL TKN_INT",
"filter : filter OP_OR filter_term",
"filter : filter filter_term",
"filter : filter_term",
"filter_term : filter_term OP_AND filter_factor",
"filter_term : filter_factor",
"filter_factor : OP_NOT filter_factor",
"filter_factor : '(' filter ')'",
"filter_factor : filter_operand",
"filter_operand : KEYW_ANY",
"filter_operand : '<' filter_aspath '>'",
"filter_operand : rp_attribute",
"filter_operand : TKN_FLTRNAME",
"filter_operand : filter_prefix",
"filter_prefix : filter_prefix_operand OP_MS",
"filter_prefix : filter_prefix_operand",
"filter_prefix_operand : TKN_ASNO",
"filter_prefix_operand : KEYW_PEERAS",
"filter_prefix_operand : TKN_ASNAME",
"filter_prefix_operand : TKN_RSNAME",
"filter_prefix_operand : '{' opt_filter_prefix_list '}'",
"opt_filter_prefix_list :",
"opt_filter_prefix_list : filter_prefix_list",
"filter_prefix_list : filter_prefix_list_prefix",
"filter_prefix_list : filter_prefix_list ',' filter_prefix_list_prefix",
"filter_prefix_list_prefix : TKN_PRFXV4",
"filter_prefix_list_prefix : TKN_PRFXV6",
"filter_prefix_list_prefix : TKN_PRFXV6DC",
"filter_prefix_list_prefix : TKN_PRFXV4RNG",
"filter_prefix_list_prefix : TKN_PRFXV6RNG",
"filter_prefix_list_prefix : TKN_PRFXV6DCRNG",
"filter_aspath : filter_aspath '|' filter_aspath_term",
"filter_aspath : filter_aspath_term",
"filter_aspath_term : filter_aspath_term filter_aspath_closure",
"filter_aspath_term : filter_aspath_closure",
"filter_aspath_closure : filter_aspath_closure '*'",
"filter_aspath_closure : filter_aspath_closure '?'",
"filter_aspath_closure : filter_aspath_closure '+'",
"filter_aspath_closure : filter_aspath_closure ASPATH_POSTFIX",
"filter_aspath_closure : filter_aspath_factor",
"filter_aspath_factor : '^'",
"filter_aspath_factor : '$'",
"filter_aspath_factor : '(' filter_aspath ')'",
"filter_aspath_factor : filter_aspath_no",
"filter_aspath_no : TKN_ASNO",
"filter_aspath_no : KEYW_PEERAS",
"filter_aspath_no : TKN_ASNAME",
"filter_aspath_no : '.'",
"filter_aspath_no : '[' filter_aspath_range ']'",
"filter_aspath_no : '[' '^' filter_aspath_range ']'",
"filter_aspath_range :",
"filter_aspath_range : filter_aspath_range TKN_ASNO",
"filter_aspath_range : filter_aspath_range KEYW_PEERAS",
"filter_aspath_range : filter_aspath_range '.'",
"filter_aspath_range : filter_aspath_range TKN_ASNO '-' TKN_ASNO",
"filter_aspath_range : filter_aspath_range TKN_ASRANGE",
"filter_aspath_range : filter_aspath_range TKN_ASNAME",
};

//#line 312 "src/main/parser/byacc/import_via.y"

protected final Logger LOGGER = LoggerFactory.getLogger(ImportViaParser.class);

private ImportViaLexer lexer;

private int yylex () {
	int yyl_return = -1;
	try {
		yyl_return = lexer.yylex();
	}
	catch (IOException e) {
		LOGGER.error(e.getMessage(), e);
	}
	return yyl_return;
}

public void yyerror (final String error) {
    String errorMessage = (yylval.sval == null ? error : yylval.sval);
    ParserHelper.parserError(errorMessage);
}

@Override
public Void parse(final String attributeValue) {
	lexer = new ImportViaLexer(new StringReader(attributeValue), this);
    final int result = yyparse();
	if (result > 0) {
	    throw new IllegalArgumentException("Unexpected parse result: " + result);
	}
	return null;
}

//#line 689 "ImportViaParser.java"
//###############################################################
// method: yylexdebug : check lexer state
//###############################################################
void yylexdebug(int state,int ch)
{
String s=null;
  if (ch < 0) ch=0;
  if (ch <= YYMAXTOKEN) //check index bounds
     s = yyname[ch];    //now get it
  if (s==null)
    s = "illegal-symbol";
  debug("state "+state+", reading "+ch+" ("+s+")");
}





//The following are now global, to aid in error reporting
int yyn;       //next next thing to do
int yym;       //
int yystate;   //current parsing state from state table
String yys;    //current token string


//###############################################################
// method: yyparse : parse input and execute indicated items
//###############################################################
int yyparse()
{
boolean doaction;
  init_stacks();
  yynerrs = 0;
  yyerrflag = 0;
  yychar = -1;          //impossible char forces a read
  yystate=0;            //initial state
  state_push(yystate);  //save it
  val_push(yylval);     //save empty value
  while (true) //until parsing is done, either correctly, or w/error
    {
    doaction=true;
    //if (yydebug) debug("loop"); 
    //#### NEXT ACTION (from reduction table)
    for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])
      {
      //if (yydebug) debug("yyn:"+yyn+"  state:"+yystate+"  yychar:"+yychar);
      if (yychar < 0)      //we want a char?
        {
        yychar = yylex();  //get next token
        //if (yydebug) debug(" next yychar:"+yychar);
        //#### ERROR CHECK ####
        if (yychar < 0)    //it it didn't work/error
          {
          yychar = 0;      //change it to default string (no -1!)
          //if (yydebug)
          //  yylexdebug(yystate,yychar);
          }
        }//yychar<0
      yyn = yysindex[yystate];  //get amount to shift by (shift index)
      if ((yyn != 0) && (yyn += yychar) >= 0 &&
          yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
        {
        //if (yydebug)
          //debug("state "+yystate+", shifting to state "+yytable[yyn]);
        //#### NEXT STATE ####
        yystate = yytable[yyn];//we are in a new state
        state_push(yystate);   //save it
        val_push(yylval);      //push our lval as the input for next rule
        yychar = -1;           //since we have 'eaten' a token, say we need another
        if (yyerrflag > 0)     //have we recovered an error?
           --yyerrflag;        //give ourselves credit
        doaction=false;        //but don't process yet
        break;   //quit the yyn=0 loop
        }

    yyn = yyrindex[yystate];  //reduce
    if ((yyn !=0 ) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
      {   //we reduced!
      //if (yydebug) debug("reduce");
      yyn = yytable[yyn];
      doaction=true; //get ready to execute
      break;         //drop down to actions
      }
    else //ERROR RECOVERY
      {
      if (yyerrflag==0)
        {
        yyerror("syntax error");
        yynerrs++;
        }
      if (yyerrflag < 3) //low error count?
        {
        yyerrflag = 3;
        while (true)   //do until break
          {
          if (stateptr<0)   //check for under & overflow here
            {
            yyerror("stack underflow. aborting...");  //note lower case 's'
            return 1;
            }
          yyn = yysindex[state_peek(0)];
          if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
            //if (yydebug)
              //debug("state "+state_peek(0)+", error recovery shifting to state "+yytable[yyn]+" ");
            yystate = yytable[yyn];
            state_push(yystate);
            val_push(yylval);
            doaction=false;
            break;
            }
          else
            {
            //if (yydebug)
              //debug("error recovery discarding state "+state_peek(0)+" ");
            if (stateptr<0)   //check for under & overflow here
              {
              yyerror("Stack underflow. aborting...");  //capital 'S'
              return 1;
              }
            state_pop();
            val_pop();
            }
          }
        }
      else            //discard this token
        {
        if (yychar == 0)
          return 1; //yyabort
        //if (yydebug)
          //{
          //yys = null;
          //if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
          //if (yys == null) yys = "illegal-symbol";
          //debug("state "+yystate+", error recovery discards token "+yychar+" ("+yys+")");
          //}
        yychar = -1;  //read another
        }
      }//end error recovery
    }//yyn=0 loop
    if (!doaction)   //any reason not to proceed?
      continue;      //skip action
    yym = yylen[yyn];          //get count of terminals on rhs
    //if (yydebug)
      //debug("state "+yystate+", reducing "+yym+" by rule "+yyn+" ("+yyrule[yyn]+")");
    if (yym>0)                 //if count of rhs not 'nil'
      yyval = val_peek(yym-1); //get current semantic value
    yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value
    switch(yyn)
      {
//########## USER-SUPPLIED ACTIONS ##########
case 57:
//#line 143 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.checkStringLength(val_peek(0).sval, 255);
}
break;
case 70:
//#line 166 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 71:
//#line 171 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 73:
//#line 177 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 90:
//#line 208 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.check32bit(val_peek(0).sval);
}
break;
case 96:
//#line 220 "src/main/parser/byacc/import_via.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
//#line 874 "ImportViaParser.java"
//########## END OF USER-SUPPLIED ACTIONS ##########
    }//switch
    //#### Now let's reduce... ####
    //if (yydebug) debug("reduce");
    state_drop(yym);             //we just reduced yylen states
    yystate = state_peek(0);     //get new state
    val_drop(yym);               //corresponding value drop
    yym = yylhs[yyn];            //select next TERMINAL(on lhs)
    if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL
      {
      //if (yydebug) debug("After reduction, shifting from state 0 to state "+YYFINAL+"");
      yystate = YYFINAL;         //explicitly say we're done
      state_push(YYFINAL);       //and save it
      val_push(yyval);           //also save the semantic value of parsing
      if (yychar < 0)            //we want another character?
        {
        yychar = yylex();        //get next character
        if (yychar<0) yychar=0;  //clean, if necessary
        //if (yydebug)
          //yylexdebug(yystate,yychar);
        }
      if (yychar == 0)          //Good exit (if lex returns 0 ;-)
         break;                 //quit the loop--all DONE
      }//if yystate
    else                        //else not done yet
      {                         //get next state and push, for next yydefred[]
      yyn = yygindex[yym];      //find out where to go
      if ((yyn != 0) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn]; //get new state
      else
        yystate = yydgoto[yym]; //else go to new defred
      //if (yydebug) debug("after reduction, shifting from state "+state_peek(0)+" to state "+yystate+"");
      state_push(yystate);     //going again, so push state & val...
      val_push(yyval);         //for next action
      }
    }//main loop
  return 0;//yyaccept!!
}
//## end of method parse() ######################################



//## run() --- for Thread #######################################
//## The -Jnorun option was used ##
//## end of method run() ########################################



//## Constructors ###############################################
//## The -Jnoconstruct option was used ##
//###############################################################



}
//################### END OF CLASS ##############################




© 2015 - 2024 Weber Informatics LLC | Privacy Policy