throw new UnrecognizedCodeException("While processing function " + func.getName() + ", found period in\r\nargument name or type and it wasn't part of a '...'");
}
} // End var arg section.
if(st.ttype == '*' || st.ttype == '&') {
//if(st.ttype == '&')
// System.out.println("Found a & in the type of one of function " + func.getName() + "'s arguments.");
if(!Name.equals(AnonymousString))
Type = Type+" "+Name;
// This expression was just sitting here without the assignment, which is all wrong.
// I think this is correct, Type=... And this probably was a major
// source of bugs in my code.
Type = Type+' '+(char)st.ttype;
Name = "";
}
if(st.ttype == '(') { // Got a pointer to a function argument
Function pfunc = new Function();
addTypeandParam = false;
pfunc.setReturnType(Type);
pfunc.setName("Pointer-to-function-type");
ntoken = st.nextToken();
System.out.println("Found pointer to function in function " + func.getName());
while(st.nextToken() != ')') {
// throw away for now... Lazy.
}
while(st.nextToken() != '(');
MungeVariables(pfunc, st);
System.out.println("Got arguments to pointer to function...");
func.addArgument(pfunc);
}
ntoken = st.nextToken();
}
// If this isn't a pointer to a function...
if(addTypeandParam && !Type.equals("")) {
if(Name.equals("")) {
//System.out.println("In function " + func.getName() + ", Name was \"\" at the end.");
Name = AnonymousString;
}
func.addArgument(Type, Name);
}
if(ntoken != ')')
ntoken = st.nextToken();
} while(ntoken != ')');
} // end MungeVariables
/**
* Parses a multiFieldDataStructure, reading in its fields, etc. Returns the Struct
* or Union object.
* @param st StreamTokenizer positioned at the struct or union keyword.
* @param insideStructure true if ReadStructure is nested in a struct or union.
* @return a new multiFieldDataStructure object.
* @exception UnrecognizedCodeException if struct was unparsible.
* @exception InvalidParameterException if StreamTokenizer wasn't positioned on struct.
* @exception IOException if StreamTokenizer can't read stream.
throw new BadOperationException("getPrecedence called with unknown operator \""+operator+"\", with constraints unary: "+unary+" prefix: "+prefix);
else
throw new BadOperationException("getPrecedence called with unknown operator \""+operator+"\", with constraints unary: "+unary+" prefix: "+prefix+"\r\nOperator - isUnary: "+op.isUnaryOperator()+" isPrefix: "+op.isPrefixOperator());
}
}
/**
* Decides if we should examine the current file or not. Checks IncludeHeaders,
* ExcludeHeaders, whether its an IDL file, and whether it starts with "mm".