{
Constructor c = (Constructor) $1;
c.Block = (Block) end_block();
+
+//To support "Sub New()" add default modifier "public"
+
+ if(current_modifiers ==0)
+ current_modifiers = Modifiers.PUBLIC;
c.ModFlags = (int) current_modifiers;
c.OptAttributes = current_attributes;
topmost.statements.Add (new Break (lexer.Location));
ArrayList a = new ArrayList();
- a.Add (new SwitchLabel (null, lexer.Location));
+ a.Add (new SwitchLabel (null, SwitchLabel.LabelType.Else, Binary.Operator.TOP, lexer.Location));
$$ = new SwitchSection ((ArrayList) a, topmost);
}
;
case_clauses
: case_clause
{
- if ($1 is ArrayList) //From expression TO expression
- $$ = $1;
- else {
-
- ArrayList labels = new ArrayList ();
-
- labels.Add ($1);
- $$ = labels;
- }
+ ArrayList labels = new ArrayList ();
+ labels.Add ($1);
+ $$ = labels;
}
| case_clauses COMMA case_clause
{
ArrayList labels = (ArrayList) ($1);
- labels.Add ($2);
+ labels.Add ($3);
$$ = labels;
}
case_clause
: opt_is comparison_operator expression
+ {
+ $$ = new SwitchLabel ((Expression) $3, SwitchLabel.LabelType.Operator, (Binary.Operator) $2, lexer.Location);
+ }
| expression
{
- $$ = new SwitchLabel ((Expression) $1, lexer.Location);
+ $$ = new SwitchLabel ((Expression) $1, SwitchLabel.LabelType.Label, Binary.Operator.TOP, lexer.Location);
}
| expression TO expression
{
- //FIXME: need to handle when expressions are character strings.
- Constant start = (Constant) $1;
- Constant end = (Constant) $3;
- int i = 0, s = 0, e = 0;
- Location l = lexer.Location ;
- ArrayList labels = new ArrayList ();
-
- if (start != null)
- s = (int) start.GetValue ();
- if(end != null)
- e = (int) end.GetValue ();
- for(i = s; i <= e; i++) {
- labels.Add(new SwitchLabel ((Expression)new IntLiteral(i), l));
- }
- $$ = labels;
+ $$ = new SwitchLabel ((Expression) $1, (Expression) $3, SwitchLabel.LabelType.Range,
+ Binary.Operator.TOP, lexer.Location);
}
;
;
comparison_operator
- : OP_LT
+ : OP_LT
+ {
+ $$ = Binary.Operator.LessThan;
+ }
| OP_GT
+ {
+ $$ = Binary.Operator.GreaterThan;
+ }
+ | OP_GE
+ {
+ $$ = Binary.Operator.GreaterThanOrEqual;
+ }
| OP_LE
+ {
+ $$ = Binary.Operator.LessThanOrEqual;
+ }
| OP_NE
- /*| OP_EQ */
+ {
+ $$ = Binary.Operator.Inequality;
+ }
+ | ASSIGN
+ {
+ $$ = Binary.Operator.Equality;
+ }
;
opt_case
{
$$ = new Argument ((Expression) $2, Argument.AType.AddressOf);
}
+ | identifier ATTR_ASSIGN expression
+ {
+ $$ = new Argument ((string) $1, (Expression) $3, Argument.AType.Expression);
+ }
;
variable_reference
AddHandler (current_block, evt_definition, handler_exp);
}
+/*
void CheckAttributeTarget (string a)
{
switch (a) {
break;
}
}
+*/
private void AddHandler (Block b, Expression evt_id, Expression handles_exp)
{
return ci;
}
+/*
void Error_ExpectingTypeName (Location l, Expression expr)
{
if (expr is Invocation){
Report.Error (-1, l, "Invalid Type definition");
}
}
+*/
public static Expression SetLeftHandFlag (Expression expr) {
if (expr is Invocation) {
return expr;
}
+/*
static bool AlwaysAccept (MemberInfo m, object filterCriteria) {
return true;
}
+*/
private void ReportError9998()
{