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

net.ripe.db.whois.common.generated.ExportParser 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/export.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: export.y

  description:
    Defines the grammar for an RPSL dexport attribute.  It was mostly
    stolen from the IRRToolSet, simplified by removing ability to parse
    things defined by a dictionary (we use XML for extensibility rather
    than a dictionary).

  notes:
    Defines tokens for the associated lexer, export.l.
*/

//#line 38 "ExportParser.java"




public class ExportParser
             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;
}
ExportParserVal val_pop()
{
  if (valptr<0)
    return new ExportParserVal();
  return valstk[valptr--];
}
void val_drop(int cnt)
{
int ptr;
  ptr=valptr-cnt;
  if (ptr<0)
    return;
  valptr = ptr;
}
ExportParserVal val_peek(int relative)
{
int ptr;
  ptr=valptr-relative;
  if (ptr<0)
    return new ExportParserVal();
  return valstk[ptr];
}
final ExportParserVal dup_yyval(ExportParserVal val)
{
  ExportParserVal dup = new ExportParserVal();
  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_RTRSNAME=275;
public final static short TKN_PRNGNAME=276;
public final static short KEYW_TO=277;
public final static short KEYW_ACTION=278;
public final static short KEYW_EXCEPT=279;
public final static short TKN_PREF=280;
public final static short TKN_MED=281;
public final static short TKN_DPA=282;
public final static short TKN_ASPATH=283;
public final static short TKN_COMMUNITY=284;
public final static short TKN_NEXT_HOP=285;
public final static short TKN_COST=286;
public final static short TKN_COMM_NO=287;
public final static short KEYW_IGP_COST=288;
public final static short KEYW_SELF=289;
public final static short KEYW_PREPEND=290;
public final static short KEYW_APPEND=291;
public final static short KEYW_DELETE=292;
public final static short KEYW_CONTAINS=293;
public final static short KEYW_AT=294;
public final static short KEYW_INTERNET=295;
public final static short KEYW_NO_EXPORT=296;
public final static short KEYW_NO_ADVERTISE=297;
public final static short KEYW_PROTOCOL=298;
public final static short TKN_PROTOCOL=299;
public final static short KEYW_INTO=300;
public final static short KEYW_REFINE=301;
public final static short KEYW_ANNOUNCE=302;
public final static short TKN_INT=303;
public final static short TKN_DNS=304;
public final static short YYERRCODE=256;
final static short yylhs[] = {                           -1,
    0,    0,    2,    2,    3,    3,    4,    4,    4,    6,
    6,    7,    7,    5,    8,    8,   10,   10,   11,   11,
   12,   12,   16,   16,   16,   17,   17,   18,   18,   13,
   13,   14,   14,   19,   19,   20,   20,   20,   21,   21,
   22,   22,   22,    1,    1,   15,   15,   23,   23,   23,
   23,   23,   23,   23,   24,   25,   25,   26,   27,   31,
   31,   28,   28,   28,   28,   28,   28,   28,   32,   33,
   33,   34,   34,   34,   34,   34,   29,   29,   30,    9,
    9,    9,   35,   35,   36,   36,   36,   37,   37,   37,
   37,   37,   39,   39,   40,   40,   40,   40,   40,   41,
   41,   42,   42,   43,   43,   38,   38,   44,   44,   45,
   45,   45,   45,   45,   46,   46,   46,   46,   47,   47,
   47,   47,   47,   47,   48,   48,   48,   48,   48,   48,
   48,
};
final static short yylen[] = {                            2,
    3,    3,    0,    2,    0,    2,    1,    3,    3,    2,
    3,    2,    3,    3,    3,    4,    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,    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,
    2,    1,    3,    1,    2,    3,    1,    1,    1,    3,
    1,    1,    2,    1,    1,    1,    1,    1,    3,    0,
    1,    1,    3,    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,    4,    0,    0,    6,    0,    0,    1,
    0,    0,    0,   28,   29,   18,    0,    0,    0,    0,
   25,   27,    0,    0,   10,    0,    0,    0,    0,    0,
    0,   15,    0,   41,   43,   44,    0,    0,    0,    0,
    0,   38,   40,    0,    0,   12,   11,    0,    9,    0,
    8,    0,    0,   88,   96,   91,   95,   98,   97,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   89,   48,   49,   50,   51,   52,   53,   54,    0,   84,
   87,   92,    0,   26,    0,    0,    0,    0,    0,    0,
   17,    0,    0,    0,   23,   24,   13,   16,   85,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  104,  105,    0,    0,  102,    0,  120,  119,  121,    0,
  122,  115,  116,    0,    0,    0,    0,  114,  118,    0,
    0,    0,   93,    0,   46,   39,   45,    0,    0,   36,
   37,   55,   57,   56,   58,    0,    0,   62,   63,   68,
   76,   72,   73,   74,   75,    0,   70,    0,    0,    0,
   77,   78,   79,   99,    0,   86,    0,  125,    0,   90,
    0,    0,  113,  110,  111,  112,    0,   83,   47,    0,
    0,   67,    0,    0,    0,    0,  103,  117,    0,  127,
    0,  130,  131,  128,  123,    0,   60,    0,   69,   71,
    0,    0,    0,  124,    0,   59,    0,   64,   65,   66,
  129,   61,
};
final static short yydgoto[] = {                          2,
   38,    3,    6,   10,   50,   12,   24,   13,   70,   18,
   32,   19,   39,   91,   85,   20,   21,   22,   40,   41,
   42,   43,   71,   72,   73,   74,   75,   76,   77,   78,
  198,  148,  156,  157,   79,   80,   81,  125,   82,   83,
  113,  114,  115,  126,  127,  128,  129,  169,
};
final static short yysindex[] = {                      -268,
 -263,    0, -253,    0, -214, -116,    0,  -22, -207,    0,
   17, -247, -233,    0,    0,    0,  -35, -172,  -40, -223,
    0,    0,   49, -110,    0, -116, -116,  -22,  216,  -38,
 -106,    0,  -35,    0,    0,    0,  -34,   72, -169, -130,
 -212,    0,    0,  -35,  -35,    0,    0,   70,    0,   17,
    0, -172,  216,    0,    0,    0,    0,    0,    0,  -99,
  -95,  -93,  103,   61,  -92,  -91, -194,  216,   90,  182,
    0,    0,    0,    0,    0,    0,    0,    0, -103,    0,
    0,    0,  -89,    0, -106,  113, -223,  -33, -122,  -34,
    0,  -34,  -34,  -34,    0,    0,    0,    0,    0, -117,
 -245, -115, -107,   66,   66,   66, -153, -152, -215, -109,
    0,    0,   65,  152,    0,  151,    0,    0,    0,   90,
    0,    0,    0,  104,  -41,   90,  -23,    0,    0,  216,
 -103,  216,    0,  136,    0,    0,    0, -130, -212,    0,
    0,    0,    0,    0,    0,  157, -153,    0,    0,    0,
    0,    0,    0,    0,    0,   45,    0,  160,  161,  162,
    0,    0,    0,    0, -194,    0,  -24,    0,  -42,    0,
   90,  -23,    0,    0,    0,    0, -103,    0,    0,  -69,
  -21,    0, -153, -153, -153, -153,    0,    0,   35,    0,
  158,    0,    0,    0,    0,   90,    0,   73,    0,    0,
   75,   79,   94,    0,  -64,    0,  -62,    0,    0,    0,
    0,    0,
};
final static short yyrindex[] = {                      -113,
    0,    0, -112,    0,    0,    0,    0,    0,    0,    0,
  207,  208,    0,    0,    0,    0,    0, -227, -249,  -27,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  112, -229, -239,
  -39,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0, -227,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   84,    0,    0,   25,
    0,    0,    0,    0,    0,    0,    0,    0,   31,    0,
    0,    0,    1,    0, -225,    0,  107,    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,   85,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  127,    0,  -29,   69,    0,    0,    0,
   62,    0,    0,    0,    0,    0,    0, -165,   16,    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,  415,    0,    0,    0,    0,   92,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  159,    0,    0,    0,    0,  -25,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,
};
final static short yygindex[] = {                         0,
    0,    0,    0,   71,   87,    0,    0,    0,  144,  185,
  164,  197,    0,    0,    0,  188,  101,    0,   -3,  133,
   63,    0,   -5,    0,    0,    0,    0,    0,    0,    0,
    0,   53, -120,   48,  -48,  -44,    0,  108,    0,    0,
    0,    0,   67,   74, -102,    0,    0,   76,
};
final static int YYTABLESIZE=686;
static short yytable[];
static { yytable();}
static void yytable(){
yytable = new short[]{                         37,
   94,   35,   84,  194,   17,   37,    9,  136,   99,    3,
    5,  107,   22,   22,   47,  106,  188,   17,  174,  176,
  170,  131,  183,  172,   14,   86,  181,   30,   30,    1,
   82,   26,  107,   88,   44,    4,  106,   31,   31,  175,
   94,   94,  143,   28,   30,   93,    5,   32,   32,   19,
  195,   20,   30,   27,   31,   45,   34,  144,  161,   94,
   94,   81,   31,  201,  202,  203,   94,  131,   29,    8,
   82,   82,   32,  162,   19,   25,   20,  111,  112,  134,
  194,  177,  171,   14,    7,  182,  138,  178,  183,   82,
   82,   80,   11,  172,  107,   23,   49,   51,  106,  171,
  107,   81,   81,  199,  109,   31,  108,   46,  109,  109,
   48,   33,   33,  206,  109,  208,  207,   89,  183,  209,
   81,   81,  183,   94,   90,  123,   92,  204,   97,  120,
  109,   80,   80,  151,  210,  121,   33,  183,  158,  159,
  160,  152,  153,  154,   95,   96,   21,   21,  103,  155,
   80,   80,   42,   82,  132,  140,  141,  149,  150,  109,
    8,  100,  109,    3,    5,  101,    8,  102,  109,  110,
  133,  135,  125,   60,   61,   62,   63,   64,   65,   66,
  124,  137,  146,  122,   81,  142,    3,  145,  147,  164,
   68,  166,  109,  163,  179,  165,  180,  168,  197,  184,
  185,  186,  205,  211,  126,  212,    2,    7,  100,  101,
   69,  116,   52,   30,   80,   98,   33,   35,   33,  125,
   87,   68,  190,   92,  139,  191,  192,  167,  193,   22,
  200,  187,   14,   34,   35,   15,    0,   35,   35,   34,
   35,   69,  173,  189,  196,   14,   22,   22,   15,   22,
   22,  126,    0,   16,   35,   68,    0,   94,   94,   94,
    0,    0,   35,   36,   94,   94,   22,   94,   94,   36,
   94,   94,   34,   67,   22,   69,   22,    0,    0,    0,
   94,   94,   94,   94,   94,   94,   94,   82,    0,   82,
    0,    0,   34,   34,   82,   82,    0,   82,   82,  190,
   82,   82,  191,  192,   67,  193,    0,    0,    0,   34,
   82,   82,   82,   82,   82,   82,   82,   34,   81,    0,
   81,  104,  105,  106,    0,   81,   81,    0,   81,   81,
    0,   81,   81,  109,    0,    0,  109,    0,   67,  109,
    0,   81,   81,   81,   81,   81,   81,   81,   80,    0,
   80,    0,    0,    0,  117,   80,   80,  118,   80,   80,
  119,   80,   80,   21,    0,    0,    0,    0,   42,   42,
    0,   80,   80,   80,   80,   80,   80,   80,    0,    0,
   21,   21,    0,   21,   21,    0,    0,    0,   42,   42,
   42,  125,    0,    0,  125,  125,    0,  125,    0,    0,
   21,    0,    0,    0,    0,   42,    0,  130,   21,   53,
   21,    0,    0,   42,   54,   55,    0,   56,   57,    0,
   58,   59,    0,  126,    0,    0,  126,  126,    0,  126,
   60,   61,   62,   63,   64,   65,   66,    0,  130,    0,
   53,    0,    0,    0,    0,   54,   55,    0,   56,   57,
  108,   58,   59,    0,  108,  108,    0,    0,    0,    0,
  108,   60,   61,   62,   63,   64,   65,   66,    0,    0,
    0,    0,    0,    0,   53,    0,  108,    0,    0,   54,
   55,    0,   56,   57,    0,   58,   59,    0,    0,    0,
    0,    0,    0,    0,    0,   60,   61,   62,   63,   64,
   65,   66,    0,    0,    0,  108,    0,    0,  108,    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,  108,    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,    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,  108,
    0,    0,  108,    0,    0,  108,
};
}
static short yycheck[];
static { yycheck(); }
static void yycheck() {
yycheck = new short[] {                         40,
    0,   41,   41,   46,   40,   40,  123,   41,   53,  123,
  123,   41,   40,   41,  125,   41,   41,   40,   42,   43,
   62,   70,   44,  126,    0,   31,  147,  277,  278,  298,
    0,  279,   62,   37,  258,  299,   62,  277,  278,   63,
   40,   41,  288,  277,  294,  258,  300,  277,  278,  277,
   93,  277,  302,  301,  294,  279,   41,  303,  274,   59,
   60,    0,  302,  184,  185,  186,  279,  116,  302,  277,
   40,   41,  302,  289,  302,   59,  302,  272,  273,   85,
   46,  130,  124,   59,  299,   41,   90,  132,   44,   59,
   60,    0,    6,  196,  124,    9,   26,   27,  124,  124,
   40,   40,   41,  125,   36,  278,   46,   59,   40,   41,
   24,  277,  278,   41,   46,   41,   44,   46,   44,   41,
   59,   60,   44,  123,  294,   36,  257,   93,   59,   40,
   62,   40,   41,  287,   41,   46,  302,   44,  291,  292,
  293,  295,  296,  297,   44,   45,   40,   41,   46,  303,
   59,   60,   41,  123,  258,   93,   94,  105,  106,   91,
  277,  261,   94,  277,  277,  261,  277,  261,  261,  261,
  260,   59,   46,  280,  281,  282,  283,  284,  285,  286,
   91,  304,  290,   94,  123,  303,  300,  303,  123,  125,
   40,   41,  124,  303,   59,   44,   40,   94,  268,   40,
   40,   40,   45,  268,   46,  268,    0,    0,  125,  125,
   60,   68,   28,   17,  123,   52,  257,  257,  257,   93,
   33,   40,  265,  257,   92,  268,  269,  120,  271,  257,
  183,  165,  268,  274,  275,  271,   -1,  277,  278,  274,
  275,   60,  266,  168,  171,  268,  274,  275,  271,  277,
  278,   93,   -1,  276,  294,   40,   -1,  257,  258,  259,
   -1,   -1,  302,  304,  264,  265,  294,  267,  268,  304,
  270,  271,  257,  123,  302,   60,  304,   -1,   -1,   -1,
  280,  281,  282,  283,  284,  285,  286,  257,   -1,  259,
   -1,   -1,  277,  278,  264,  265,   -1,  267,  268,  265,
  270,  271,  268,  269,  123,  271,   -1,   -1,   -1,  294,
  280,  281,  282,  283,  284,  285,  286,  302,  257,   -1,
  259,  261,  262,  263,   -1,  264,  265,   -1,  267,  268,
   -1,  270,  271,  265,   -1,   -1,  268,   -1,  123,  271,
   -1,  280,  281,  282,  283,  284,  285,  286,  257,   -1,
  259,   -1,   -1,   -1,  265,  264,  265,  268,  267,  268,
  271,  270,  271,  257,   -1,   -1,   -1,   -1,  257,  258,
   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
  274,  275,   -1,  277,  278,   -1,   -1,   -1,  277,  278,
  279,  265,   -1,   -1,  268,  269,   -1,  271,   -1,   -1,
  294,   -1,   -1,   -1,   -1,  294,   -1,  257,  302,  259,
  304,   -1,   -1,  302,  264,  265,   -1,  267,  268,   -1,
  270,  271,   -1,  265,   -1,   -1,  268,  269,   -1,  271,
  280,  281,  282,  283,  284,  285,  286,   -1,  257,   -1,
  259,   -1,   -1,   -1,   -1,  264,  265,   -1,  267,  268,
   36,  270,  271,   -1,   40,   41,   -1,   -1,   -1,   -1,
   46,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
   -1,   -1,   -1,   -1,  259,   -1,   62,   -1,   -1,  264,
  265,   -1,  267,  268,   -1,  270,  271,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,  280,  281,  282,  283,  284,
  285,  286,   -1,   -1,   -1,   91,   -1,   -1,   94,   -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,  124,   -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,   -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=304;
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_RTRSNAME","TKN_PRNGNAME","KEYW_TO",
"KEYW_ACTION","KEYW_EXCEPT","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_ANNOUNCE","TKN_INT","TKN_DNS",
};
final static String yyrule[] = {
"$accept : export",
"export : opt_protocol_from opt_protocol_into export_expr",
"export : opt_protocol_from opt_protocol_into export_factor",
"opt_protocol_from :",
"opt_protocol_from : KEYW_PROTOCOL TKN_PROTOCOL",
"opt_protocol_into :",
"opt_protocol_into : KEYW_INTO TKN_PROTOCOL",
"export_expr : export_term",
"export_expr : export_term KEYW_REFINE export_expr",
"export_expr : export_term KEYW_EXCEPT export_expr",
"export_term : export_factor ';'",
"export_term : '{' export_factor_list '}'",
"export_factor_list : export_factor ';'",
"export_factor_list : export_factor_list export_factor ';'",
"export_factor : export_peering_action_list KEYW_ANNOUNCE filter",
"export_peering_action_list : KEYW_TO peering opt_action",
"export_peering_action_list : export_peering_action_list KEYW_TO 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 : 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 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 : rp_attribute",
"filter_operand : '<' filter_aspath '>'",
"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_PRFXV4RNG",
"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 286 "src/main/parser/byacc/export.y"


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

private ExportLexer 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 (String error) {
    String errorMessage = (yylval.sval == null ? error : yylval.sval);
    ParserHelper.parserError(errorMessage);
}

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


//#line 623 "ExportParser.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 42:
//#line 123 "src/main/parser/byacc/export.y"
{
	ParserHelper.checkStringLength(val_peek(0).sval, 255);
}
break;
case 55:
//#line 146 "src/main/parser/byacc/export.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 56:
//#line 151 "src/main/parser/byacc/export.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 58:
//#line 157 "src/main/parser/byacc/export.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
case 75:
//#line 188 "src/main/parser/byacc/export.y"
{
	ParserHelper.check32bit(val_peek(0).sval);
}
break;
case 79:
//#line 198 "src/main/parser/byacc/export.y"
{
	ParserHelper.check16bit(val_peek(0).sval);
}
break;
//#line 808 "ExportParser.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