The guts of this class are automatically generated by jay from the grammar rules and semantics below.
Public Types | |
enum | Modifiers { PUBLIC, STATIC } |
Relevant modifiers. More... | |
Public Member Functions | |
CSharpParser (Hashtable classes) | |
Initialize the parser. | |
void | yyerror (string message) |
simplified error message. | |
void | yyerror (string message, string[] expected) |
(syntax) error message. | |
Object | yyparse (yyParser.yyInput yyLex, Object yyd) |
the generated parser, with debugging messages. | |
Object | yyparse (yyParser.yyInput yyLex) |
the generated parser. | |
bool | parse (TextReader reader, string fname) |
Parse a C# module. | |
Protected Member Functions | |
string[] | yyExpecting (int state) |
computes list of expected tokens on error by tracing the tables. | |
Object | yyDefault (Object first) |
executed at the beginning of a reduce action. | |
Protected Attributes | |
int | yyMax |
initial size and increment of the state/value stack [default 256]. | |
Static Protected Attributes | |
int | yyFinal = 4 |
debugging support, requires the package jay.yydebug. | |
string[] | yyNames |
short[] | yyDgoto |
short[] | yySindex |
short[] | yyRindex |
short[] | yyGindex |
short[] | yyTable |
short[] | yyCheck |
Private Member Functions | |
VariableDecl | resolveVar (Ref r) |
Resolve given reference to a VariableDecl (block variable, method parameter, class field). | |
Method | resolveMethod (Ref r, IList args) |
Resolve given reference to a Method. | |
Expr | makeRefExpr (VariableDecl v, Ref r) |
Create a reference expression to a given variable declaration. | |
Expr | makeAssign (Object a, Expr e) |
Create and return an assignment expression for a = e. | |
Expr | makeRefAssign (Ref r, Expr e) |
Return an assignment Expression for r = e. | |
Expr | makeCall (Ref r, Method m, List pars) |
Return a method call expression for m(pars). | |
void | chkb (Object o) |
Assert that given object is a boolean expression and report error if not. | |
void | chki (Object o) |
Assert that given object is an integer expression and report error if not. | |
void | chkf (Object o) |
Assert that given object is a double expression and report error if not. | |
void | chks (Object o) |
Assert that given object is a string expression and report error if not. | |
void | chksametype (Object o1, Object o2) |
Assert that given objects are expressions of the same type and report an error if not. | |
void | errNumExp () |
Error report: numeric expression expected. | |
void | errAssignmentTypeMismatch () |
Error report: assignment type mismatch. | |
void | errNotAssignable (Expr e) |
Error report: expression is not assignable. | |
void | errUnknownType () |
Error report: unknown type. | |
void | errBreakContNoLoop () |
Error report: break or continue used outside of a loop. | |
void | errUndeclaredId (string id) |
Error report: undeclared identifier. | |
void | errVoidReturn () |
Error report: return without value in non-void method. | |
void | errNoVoidReturn () |
Error report: return with value in void method. | |
void | errReturnType () |
Error report: return value does not match method return type. | |
void | errWrongCallParams () |
Error report: incompatible arguments in method call. | |
void | errNewType () |
Error report: new must be used with class types. | |
void | errNewSyntax () |
Error report: syntax error in new expression. | |
void | errNonArrayElementAccess (string e) |
Error report: element access of non-array expression. | |
void | errNoMatchingCtor () |
Error report: no matching constructor for given arguments. | |
void | errStaticCtor () |
Error report: static constructor is forbidden. | |
void | errNonStaticMethod () |
Error report: nonstatic method called of static class reference. | |
void | errDuplicateMethod () |
Error report: ambiguous method declaration. | |
void | errUnimplOp () |
Error report: unimplemented operator. | |
void | errClassBase () |
Error report: invalid class ancestor. | |
void | errStubTypeForbidden () |
Error report: stubs are invalid as local block variables. | |
void | errNonStubMember (string var) |
Error report: member access of non-stub expression. | |
void | errOneDimArrayAccess () |
Error report: currently supports only one-dimensional arrays. | |
Private Attributes | |
Block | currBlock |
Currently constructed and parsed statement block. | |
Type | currDeclType |
Type of the most recent member/variable declaration. | |
Class | stubDeclClass |
Particular stub class if currDeclType == stubType. | |
int | arrayDeclDim |
Size of the recently declared array if currDeclType == arrayType. | |
Type | arrayElementType |
Element type of the recently declared array if currDeclType == arrayType. | |
Method | currMethod |
Currently constructed and parsed method. | |
Class | currClass |
Currently constructed and parsed class. | |
Attribute | currAttr |
Currently constructed attribute in attribute list. | |
List | attributes |
Attributes of the most recent declaration. | |
int | loopDepth |
Current loop depth. | |
Hashtable | classes |
Dictionary (string -> Class) of all known classes. | |
IList | modifiers |
Modifiers of the most recent declaration. | |
Tokenizer | lexer |
C# scanner (lexical analysis). | |
Static Private Attributes | |
Type | stubType = ( new Class("", null, "" ) ).GetType() |
Stub type constant for easier comparisons. | |
Type | arrayType = ( new List() ).GetType() |
Array type constant for easier comparisons. | |
short[] | yyLhs |
short[] | yyLen |
short[] | yyDefRed |
|
Relevant modifiers.
|
|
Initialize the parser.
|
|
Assert that given object is a boolean expression and report error if not.
|
|
Assert that given object is a double expression and report error if not.
|
|
Assert that given object is an integer expression and report error if not.
|
|
Assert that given object is a string expression and report error if not.
|
|
Assert that given objects are expressions of the same type and report an error if not.
|
|
Error report: assignment type mismatch.
|
|
Error report: break or continue used outside of a loop.
|
|
Error report: invalid class ancestor.
|
|
Error report: ambiguous method declaration.
|
|
Error report: syntax error in new expression.
|
|
Error report: new must be used with class types.
|
|
Error report: no matching constructor for given arguments.
|
|
Error report: element access of non-array expression.
|
|
Error report: nonstatic method called of static class reference.
|
|
Error report: member access of non-stub expression.
|
|
Error report: expression is not assignable.
|
|
Error report: return with value in void method.
|
|
Error report: numeric expression expected.
|
|
Error report: currently supports only one-dimensional arrays.
|
|
Error report: return value does not match method return type.
|
|
Error report: static constructor is forbidden.
|
|
Error report: stubs are invalid as local block variables.
|
|
Error report: undeclared identifier.
|
|
Error report: unimplemented operator.
|
|
Error report: unknown type.
|
|
Error report: return without value in non-void method.
|
|
Error report: incompatible arguments in method call.
|
|
Create and return an assignment expression for a = e.
|
|
Return a method call expression for m(pars).
|
|
Return an assignment Expression for r = e. Needed for local variable initializers, where there is no left-hand expression. |
|
Create a reference expression to a given variable declaration. Note that we cannot directly save v into a Ref since at runtime the IDs will resolve to different variables. |
|
Parse a C# module. Classes are added to the list given in the constructor.
|
|
Resolve given reference to a Method.
|
|
Resolve given reference to a VariableDecl (block variable, method parameter, class field). We cannot use Ref.resolve() for that since there is not yet a method call stack, nor a Class.getCurrentClass(). This also checks if an ID is allowed at the calling place at all (i. e. field initializers must be constant expressions), and that non-stub QIDs must be unqualified (restriction in cs2ccmb since we only deal with one class). |
|
executed at the beginning of a reduce action. Used as $$ = yyDefault($1), prior to the user-specified action, if any. Can be overwritten to provide deep copy, etc.
|
|
(syntax) error message. Can be overwritten to control message format.
|
|
simplified error message.
|
|
computes list of expected tokens on error by tracing the tables.
|
|
the generated parser. Maintains a state and a value stack, currently with fixed maximum size.
|
|
the generated parser, with debugging messages. Maintains a state and a value stack, currently with fixed maximum size.
|
|
Size of the recently declared array if currDeclType == arrayType.
|
|
Element type of the recently declared array if currDeclType == arrayType.
|
|
Array type constant for easier comparisons.
|
|
Attributes of the most recent declaration. This is required since there can be more than one field in one declaration and we cannot pass the attributes directly as arguments "down" the rules. |
|
Dictionary (string -> Class) of all known classes.
|
|
Currently constructed attribute in attribute list.
|
|
Currently constructed and parsed statement block.
|
|
Currently constructed and parsed class.
|
|
Type of the most recent member/variable declaration.
|
|
Currently constructed and parsed method.
|
|
C# scanner (lexical analysis).
|
|
Current loop depth. Used to determine the validity of a break/continue statement. |
|
Modifiers of the most recent declaration.
|
|
Particular stub class if currDeclType == stubType.
|
|
Stub type constant for easier comparisons.
|
|
|
|
|
|
Initial value:
|
|
debugging support, requires the package jay.yydebug. Set to null to suppress debugging messages. |
|
Initial value:
|
|
|
|
|
|
initial size and increment of the state/value stack [default 256]. This is not final so that it can be overwritten outside of invocations of yyparse(). |
|
|
|
|
|
|
|
|