📄 bifv015.java
字号:
Vector properties = new Vector();
IFProbabilityEntry e = null;
Vector entries = new Vector();
Vector defs = new Vector();
Vector tabs = new Vector();
double def[] = null;
double tab[] = null;
jj_consume_token(21);
label_6:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PROPERTY:
case DEFAULTVALUE:
case TABLEVALUES:
case 26:
;
break;
default:
jj_la1[9] = jj_gen;
break label_6;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PROPERTY:
s = Property();
properties.addElement(s);
break;
case DEFAULTVALUE:
def = ProbabilityDefaultEntry();
defs.addElement(def);
break;
case 26:
e = ProbabilityEntry();
entries.addElement(e);
break;
case TABLEVALUES:
tab = ProbabilityTable();
tabs.addElement(tab);
break;
default:
jj_la1[10] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
jj_consume_token(22);
upf.set_properties(properties);
upf.set_defaults(defs);
upf.set_entries(entries);
upf.set_tables(tabs);
}
final public IFProbabilityEntry ProbabilityEntry() throws ParseException {
String s[];
double d[];
s = ProbabilityValuesList();
d = FloatingPointList();
jj_consume_token(25);
{if (true) return( new IFProbabilityEntry(s, d) );}
throw new Error("Missing return statement in function");
}
/* Parse the list of Probability values in an entry */
final public String[] ProbabilityValuesList() throws ParseException {
int i;
Enumeration e;
String variable_name;
String vs[];
Vector v_list = new Vector();
jj_consume_token(26);
variable_name = ProbabilityVariableValue();
v_list.addElement(variable_name);
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STRING:
;
break;
default:
jj_la1[11] = jj_gen;
break label_7;
}
variable_name = ProbabilityVariableValue();
v_list.addElement(variable_name);
}
jj_consume_token(27);
vs = new String[v_list.size()];
for (e=v_list.elements(), i=0; e.hasMoreElements(); i++)
vs[i] = (String)(e.nextElement());
{if (true) return(vs);}
throw new Error("Missing return statement in function");
}
final public double[] ProbabilityDefaultEntry() throws ParseException {
double d[];
jj_consume_token(DEFAULTVALUE);
d = FloatingPointList();
jj_consume_token(25);
{if (true) return(d);}
throw new Error("Missing return statement in function");
}
final public double[] ProbabilityTable() throws ParseException {
double d[];
jj_consume_token(TABLEVALUES);
d = FloatingPointList();
jj_consume_token(25);
{if (true) return(d);}
throw new Error("Missing return statement in function");
}
/* ====================================================== */
/* Some general purpose non-terminals */
/* ====================================================== */
/* Pick a list of non-negative floating numbers */
final public double[] FloatingPointList() throws ParseException {
int i;
Double d;
double ds[];
Vector d_list = new Vector();
Enumeration e;
d = FloatingPointNumber();
d_list.addElement(d);
label_8:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NON_NEGATIVE_NUMBER:
;
break;
default:
jj_la1[12] = jj_gen;
break label_8;
}
d = FloatingPointNumber();
d_list.addElement(d);
}
ds = new double[d_list.size()];
for (e=d_list.elements(), i=0; e.hasMoreElements(); i++) {
d = (Double)(e.nextElement());
ds[i] = d.doubleValue();
}
{if (true) return(ds);}
throw new Error("Missing return statement in function");
}
/* Pick a non-negative floating number; necessary to allow *
* ignored characters and comments to exist in the middle *
* of a FloatingPointList() */
final public Double FloatingPointNumber() throws ParseException {
Token t;
t = jj_consume_token(NON_NEGATIVE_NUMBER);
{if (true) return( Double.valueOf(t.image) );}
throw new Error("Missing return statement in function");
}
/* Property definition */
final public String Property() throws ParseException {
String s;
jj_consume_token(PROPERTY);
s = getString();
jj_consume_token(25);
{if (true) return(s);}
throw new Error("Missing return statement in function");
}
/* String */
final public String getString() throws ParseException {
Token t;
t = jj_consume_token(STRING);
{if (true) return( (t.image).substring(1,t.image.length()-1) );}
throw new Error("Missing return statement in function");
}
public BIFv015TokenManager token_source;
ASCII_CharStream jj_input_stream;
public Token token, jj_nt;
private int jj_ntk;
private int jj_gen;
final private int[] jj_la1 = new int[13];
final private int[] jj_la1_0 = {0x1800,0x1800,0x2000,0x6000,0x6000,0x100000,0x10000000,0x100000,0x10000000,0x4032000,0x4032000,0x100000,0x40000,};
public BIFv015(java.io.InputStream stream) {
jj_input_stream = new ASCII_CharStream(stream, 1, 1);
token_source = new BIFv015TokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 13; i++) jj_la1[i] = -1;
}
public void ReInit(java.io.InputStream stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 13; i++) jj_la1[i] = -1;
}
public BIFv015(BIFv015TokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 13; i++) jj_la1[i] = -1;
}
public void ReInit(BIFv015TokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 13; i++) jj_la1[i] = -1;
}
final private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
final public Token getNextToken() {
if (token.next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
final public Token getToken(int index) {
Token t = token;
for (int i = 0; i < index; i++) {
if (t.next != null) t = t.next;
else t = t.next = token_source.getNextToken();
}
return t;
}
final private int jj_ntk() {
if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
}
private java.util.Vector jj_expentries = new java.util.Vector();
private int[] jj_expentry;
private int jj_kind = -1;
final public ParseException generateParseException() {
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[29];
for (int i = 0; i < 29; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 13; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1<<j)) != 0) {
la1tokens[j] = true;
}
}
}
}
for (int i = 0; i < 29; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
jj_expentries.addElement(jj_expentry);
}
}
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
exptokseq[i] = (int[])jj_expentries.elementAt(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
final public void enable_tracing() {
}
final public void disable_tracing() {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -