Browse Source

Updated/merged mcs.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
574994c01a
  1. 99
      ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs
  2. 47
      ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs
  3. 4
      ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs
  4. 1241
      ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs
  5. 4
      ICSharpCode.NRefactory.CSharp/Parser/mcs/const.cs
  6. 5377
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs
  7. 69
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay
  8. 46
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs
  9. 22
      ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs
  10. 14
      ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs
  11. 50
      ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs
  12. 5
      ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs
  13. 19
      ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs
  14. 61
      ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs
  15. 7
      ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs
  16. 11
      ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs
  17. 23
      ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs
  18. 14
      ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs
  19. 2
      ICSharpCode.NRefactory.CSharp/Parser/mcs/linq.cs
  20. 7
      ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs
  21. 2
      ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs
  22. 19
      ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs
  23. 10
      ICSharpCode.NRefactory.CSharp/Parser/mcs/module.cs
  24. 70
      ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs
  25. 24
      ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs
  26. 3
      ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs
  27. 32
      ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs
  28. 18
      ICSharpCode.NRefactory.CSharp/Parser/mcs/visit.cs

99
ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs

@ -299,23 +299,36 @@ namespace ICSharpCode.NRefactory.CSharp @@ -299,23 +299,36 @@ namespace ICSharpCode.NRefactory.CSharp
public override void Visit (NamespaceContainer nspace)
{
NamespaceDeclaration nDecl = null;
var loc = LocationsBag.GetLocations (nspace);
if (nspace.NS != null && !string.IsNullOrEmpty (nspace.NS.Name)) {
nDecl = new NamespaceDeclaration ();
// nDecl.AddChild (new CSharpTokenNode (Convert (nspace.NamespaceLocation), "namespace".Length), NamespaceDeclaration.Roles.Keyword);
ConvertNamespaceName (nspace.NS.MemberName, nDecl);
// nDecl.AddChild (new CSharpTokenNode (Convert (nspace.OpenBrace), 1), NamespaceDeclaration.Roles.LBrace);
if (loc != null)
nDecl.AddChild (new CSharpTokenNode (Convert (loc[0]), "namespace".Length), NamespaceDeclaration.Roles.Keyword);
ConvertNamespaceName (nspace.RealMemberName, nDecl);
if (loc != null && loc.Count > 1)
nDecl.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), NamespaceDeclaration.Roles.LBrace);
AddToNamespace (nDecl);
namespaceStack.Push (nDecl);
}
if (nspace.Usings != null) {
foreach (var us in nspace.Usings) {
us.Accept (this);
}
}
foreach (var container in nspace.Containers) {
container.Accept (this);
if (nspace.Containers != null) {
foreach (var container in nspace.Containers) {
Console.WriteLine ("add container:"+ container);
container.Accept (this);
}
}
if (nDecl != null) {
// nDecl.AddChild (new CSharpTokenNode (Convert (nspace.CloseBrace), 1), NamespaceDeclaration.Roles.RBrace);
// if (!nspace.OptSemicolon.IsNull)
// nDecl.AddChild (new CSharpTokenNode (Convert (nspace.OptSemicolon), 1), NamespaceDeclaration.Roles.Semicolon);
if (loc != null && loc.Count > 2)
nDecl.AddChild (new CSharpTokenNode (Convert (loc[2]), 1), NamespaceDeclaration.Roles.RBrace);
if (loc != null && loc.Count > 3)
nDecl.AddChild (new CSharpTokenNode (Convert (loc[3]), 1), NamespaceDeclaration.Roles.Semicolon);
namespaceStack.Pop ();
}
@ -347,35 +360,44 @@ namespace ICSharpCode.NRefactory.CSharp @@ -347,35 +360,44 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
// public override void Visit (UsingsBag.Using u)
// {
// UsingDeclaration ud = new UsingDeclaration ();
// ud.AddChild (new CSharpTokenNode (Convert (u.UsingLocation), "using".Length), UsingDeclaration.Roles.Keyword);
// ud.AddChild (ConvertToType (u.NSpace), UsingDeclaration.ImportRole);
// ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingDeclaration.Roles.Semicolon);
// AddToNamespace (ud);
// }
// public override void Visit (UsingsBag.AliasUsing u)
// {
// UsingAliasDeclaration ud = new UsingAliasDeclaration ();
// ud.AddChild (new CSharpTokenNode (Convert (u.UsingLocation), "using".Length), UsingAliasDeclaration.Roles.Keyword);
// ud.AddChild (Identifier.Create (u.Identifier.Value, Convert (u.Identifier.Location)), UsingAliasDeclaration.AliasRole);
// ud.AddChild (new CSharpTokenNode (Convert (u.AssignLocation), 1), UsingAliasDeclaration.Roles.Assign);
// ud.AddChild (ConvertToType (u.Nspace), UsingAliasDeclaration.ImportRole);
// ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon);
// AddToNamespace (ud);
// }
//
// public override void Visit (UsingsBag.ExternAlias u)
// {
// var ud = new ExternAliasDeclaration ();
// ud.AddChild (new CSharpTokenNode (Convert (u.ExternLocation), "extern".Length), ExternAliasDeclaration.Roles.Keyword);
// ud.AddChild (new CSharpTokenNode (Convert (u.AliasLocation), "alias".Length), ExternAliasDeclaration.AliasRole);
// ud.AddChild (Identifier.Create (u.Identifier.Value, Convert (u.Identifier.Location)), ExternAliasDeclaration.Roles.Identifier);
// ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon);
// AddToNamespace (ud);
// }
public override void Visit (UsingNamespace un)
{
var ud = new UsingDeclaration ();
var loc = LocationsBag.GetLocations (un);
ud.AddChild (new CSharpTokenNode (Convert (un.Location), "using".Length), UsingDeclaration.Roles.Keyword);
ud.AddChild (ConvertToType (un.NamespaceExpression), UsingDeclaration.ImportRole);
if (loc != null)
ud.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), UsingDeclaration.Roles.Semicolon);
AddToNamespace (ud);
}
public override void Visit (UsingAliasNamespace uan)
{
var ud = new UsingAliasDeclaration ();
var loc = LocationsBag.GetLocations (uan);
ud.AddChild (new CSharpTokenNode (Convert (uan.Location), "using".Length), UsingAliasDeclaration.Roles.Keyword);
ud.AddChild (Identifier.Create (uan.Alias.Value, Convert (uan.Alias.Location)), UsingAliasDeclaration.AliasRole);
if (loc != null)
ud.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), UsingAliasDeclaration.Roles.Assign);
ud.AddChild (ConvertToType (uan.NamespaceExpression), UsingAliasDeclaration.ImportRole);
if (loc != null && loc.Count > 1)
ud.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), UsingAliasDeclaration.Roles.Semicolon);
AddToNamespace (ud);
}
public override void Visit (UsingExternAlias uea)
{
var ud = new ExternAliasDeclaration ();
var loc = LocationsBag.GetLocations (uea);
ud.AddChild (new CSharpTokenNode (Convert (uea.Location), "extern".Length), ExternAliasDeclaration.Roles.Keyword);
if (loc != null)
ud.AddChild (new CSharpTokenNode (Convert (loc[0]), "alias".Length), ExternAliasDeclaration.AliasRole);
ud.AddChild (Identifier.Create (uea.Alias.Value, Convert (uea.Alias.Location)), ExternAliasDeclaration.Roles.Identifier);
if (loc != null && loc.Count > 1)
ud.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), UsingAliasDeclaration.Roles.Semicolon);
AddToNamespace (ud);
}
AstType ConvertImport (MemberName memberName)
{
@ -613,7 +635,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -613,7 +635,7 @@ namespace ICSharpCode.NRefactory.CSharp
newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.LBrace);
typeStack.Push (newType);
foreach (EnumMember member in e.OrderedAllMembers) {
foreach (EnumMember member in e.Members) {
Visit (member);
if (location != null && curLoc < location.Count - 1) //last one is closing brace
newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Comma);
@ -3517,6 +3539,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -3517,6 +3539,7 @@ namespace ICSharpCode.NRefactory.CSharp
};
var unit = Parse (top, fileName, lineModifier);
unit.Errors.AddRange (errorReportPrinter.Errors);
CompilerCallableEntryPoint.Reset ();
return unit;
}
}

47
ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs

@ -183,7 +183,6 @@ namespace Mono.CSharp { @@ -183,7 +183,6 @@ namespace Mono.CSharp {
// Unique storey ID
public readonly int ID;
static int unique_id;
public readonly Block OriginalSourceBlock;
@ -202,11 +201,11 @@ namespace Mono.CSharp { @@ -202,11 +201,11 @@ namespace Mono.CSharp {
public Expression Instance;
public AnonymousMethodStorey (Block block, TypeDefinition parent, MemberBase host, TypeParameters tparams, string name)
: base (parent, MakeMemberName (host, name, unique_id, tparams, block.StartLocation),
: base (parent, MakeMemberName (host, name, parent.Module.CounterAnonymousContainers, tparams, block.StartLocation),
tparams, Modifiers.SEALED)
{
OriginalSourceBlock = block;
ID = unique_id++;
ID = parent.Module.CounterAnonymousContainers++;
}
public void AddCapturedThisField (EmitContext ec)
@ -497,8 +496,10 @@ namespace Mono.CSharp { @@ -497,8 +496,10 @@ namespace Mono.CSharp {
}
}
public override void EmitContainer ()
public override void Emit ()
{
base.Emit ();
SymbolWriter.DefineAnonymousScope (ID);
if (hoisted_this != null)
@ -519,8 +520,6 @@ namespace Mono.CSharp { @@ -519,8 +520,6 @@ namespace Mono.CSharp {
SymbolWriter.DefineCapturedScope (ID, sf.Storey.ID, sf.Field.Name);
}
}
base.EmitContainer ();
}
//
@ -597,11 +596,6 @@ namespace Mono.CSharp { @@ -597,11 +596,6 @@ namespace Mono.CSharp {
public IList<ExplicitBlock> ReferencesFromChildrenBlock {
get { return children_references; }
}
public static void Reset ()
{
unique_id = 0;
}
}
public abstract class HoistedVariable
@ -1337,7 +1331,7 @@ namespace Mono.CSharp { @@ -1337,7 +1331,7 @@ namespace Mono.CSharp {
this.Storey = storey;
this.RealName = real_name;
Parent.PartialContainer.AddMethod (this);
Parent.PartialContainer.Members.Add (this);
Block = new ToplevelBlock (am.block, parameters);
}
@ -1496,8 +1490,6 @@ namespace Mono.CSharp { @@ -1496,8 +1490,6 @@ namespace Mono.CSharp {
string block_name;
TypeInferenceContext return_inference;
static int unique_id;
public AnonymousMethodBody (ParametersCompiled parameters,
ParametersBlock block, TypeSpec return_type, TypeSpec delegate_type,
Location loc)
@ -1587,7 +1579,7 @@ namespace Mono.CSharp { @@ -1587,7 +1579,7 @@ namespace Mono.CSharp {
MemberCore mc = ec.MemberContext as MemberCore;
string name = CompilerGeneratedClass.MakeName (parent != storey ? block_name : null,
"m", null, unique_id++);
"m", null, ec.Module.CounterAnonymousMethods++);
MemberName member_name;
if (storey == null && ec.CurrentTypeParameters != null) {
@ -1643,7 +1635,7 @@ namespace Mono.CSharp { @@ -1643,7 +1635,7 @@ namespace Mono.CSharp {
//
if (!method.MemberName.IsGeneric) {
var parent = method.Parent.PartialContainer;
int id = parent.Fields == null ? 0 : parent.Fields.Count;
int id = parent.AnonymousMethodsCounter++;
var cache_type = storey != null && storey.Mutator != null ? storey.Mutator.Mutate (type) : type;
am_cache = new Field (parent, new TypeExpression (cache_type, loc),
@ -1752,11 +1744,6 @@ namespace Mono.CSharp { @@ -1752,11 +1744,6 @@ namespace Mono.CSharp {
{
return TypeManager.CSharpName (type);
}
public static void Reset ()
{
unique_id = 0;
}
}
//
@ -1764,7 +1751,6 @@ namespace Mono.CSharp { @@ -1764,7 +1751,6 @@ namespace Mono.CSharp {
//
public class AnonymousTypeClass : CompilerGeneratedClass
{
static int types_counter;
public const string ClassNamePrefix = "<>__AnonType";
public const string SignatureForError = "anonymous type";
@ -1778,7 +1764,7 @@ namespace Mono.CSharp { @@ -1778,7 +1764,7 @@ namespace Mono.CSharp {
public static AnonymousTypeClass Create (TypeContainer parent, IList<AnonymousTypeParameter> parameters, Location loc)
{
string name = ClassNamePrefix + types_counter++;
string name = ClassNamePrefix + parent.Module.CounterAnonymousTypes++;
ParametersCompiled all_parameters;
TypeParameters tparams = null;
@ -1850,7 +1836,7 @@ namespace Mono.CSharp { @@ -1850,7 +1836,7 @@ namespace Mono.CSharp {
new MemberName (p.Name, p.Location), null);
prop.Get = new Property.GetMethod (prop, 0, null, p.Location);
prop.Get.Block = get_block;
a_type.AddProperty (prop);
a_type.AddMember (prop);
}
if (error)
@ -1860,11 +1846,6 @@ namespace Mono.CSharp { @@ -1860,11 +1846,6 @@ namespace Mono.CSharp {
return a_type;
}
public static void Reset ()
{
types_counter = 0;
}
protected override bool DoDefineMembers ()
{
if (!base.DoDefineMembers ())
@ -1911,7 +1892,7 @@ namespace Mono.CSharp { @@ -1911,7 +1892,7 @@ namespace Mono.CSharp {
Expression rs_hashcode = new IntConstant (Compiler.BuiltinTypes, -2128831035, loc);
for (int i = 0; i < parameters.Count; ++i) {
var p = parameters [i];
var f = Fields [i];
var f = (Field) Members [i * 2];
MemberAccess equality_comparer = new MemberAccess (new MemberAccess (
system_collections_generic, "EqualityComparer",
@ -1988,7 +1969,7 @@ namespace Mono.CSharp { @@ -1988,7 +1969,7 @@ namespace Mono.CSharp {
equals.Block = equals_block;
equals.Define ();
AddMethod (equals);
Members.Add (equals);
//
// GetHashCode () override
@ -2042,7 +2023,7 @@ namespace Mono.CSharp { @@ -2042,7 +2023,7 @@ namespace Mono.CSharp {
hashcode_block.AddStatement (new Return (hash_variable, loc));
hashcode.Block = hashcode_top;
hashcode.Define ();
AddMethod (hashcode);
Members.Add (hashcode);
//
// ToString () override
@ -2052,7 +2033,7 @@ namespace Mono.CSharp { @@ -2052,7 +2033,7 @@ namespace Mono.CSharp {
tostring_block.AddStatement (new Return (string_concat, loc));
tostring.Block = tostring_block;
tostring.Define ();
AddMethod (tostring);
Members.Add (tostring);
return true;
}

4
ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs

@ -675,10 +675,12 @@ namespace Mono.CSharp @@ -675,10 +675,12 @@ namespace Mono.CSharp
builder = AddCompilerGeneratedField ("$builder", new TypeExpression (bt, Location));
var ctor = DefineDefaultConstructor (false);
if (!base.DoDefineMembers ())
return false;
var block = instance_constructors[0].Block;
Block block = ctor.Block;
var mg = MethodGroupExpr.CreatePredefined (builder_factory, bt, Location);
block.AddStatement (

1241
ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs

File diff suppressed because it is too large Load Diff

4
ICSharpCode.NRefactory.CSharp/Parser/mcs/const.cs

@ -63,12 +63,12 @@ namespace Mono.CSharp { @@ -63,12 +63,12 @@ namespace Mono.CSharp {
if (declarators != null) {
var t = new TypeExpression (MemberType, TypeExpression.Location);
int index = Parent.PartialContainer.Constants.IndexOf (this);
foreach (var d in declarators) {
var c = new Const (Parent, t, ModFlags & ~Modifiers.STATIC, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);
c.initializer = d.Initializer;
((ConstInitializer) c.initializer).Name = d.Name.Value;
Parent.PartialContainer.Constants.Insert (++index, c);
c.Define ();
Parent.PartialContainer.Members.Add (c);
}
}

5377
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs

File diff suppressed because it is too large Load Diff

69
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay

@ -86,7 +86,7 @@ namespace Mono.CSharp @@ -86,7 +86,7 @@ namespace Mono.CSharp
///
/// Controls the verbosity of the errors produced by the parser
///
static public int yacc_verbose_flag;
int yacc_verbose_flag;
///
/// Used by the interactive shell, flags whether EOF was reached
@ -978,7 +978,7 @@ constant_declaration @@ -978,7 +978,7 @@ constant_declaration
var lt = (Tokenizer.LocatedToken) $5;
var mod = (Modifiers) $2;
current_field = new Const (current_type, (FullNamedExpression) $4, mod, new MemberName (lt.Value, lt.Location), (Attributes) $1);
current_container.PartialContainer.AddConstant ((Const) current_field);
current_type.AddMember (current_field);
if ((mod & Modifiers.STATIC) != 0) {
report.Error (504, current_field.Location, "The constant `{0}' cannot be marked static", current_field.GetSignatureForError ());
@ -1060,7 +1060,7 @@ field_declaration @@ -1060,7 +1060,7 @@ field_declaration
var lt = (Tokenizer.LocatedToken) $4;
current_field = new Field (current_type, type, (Modifiers) $2, new MemberName (lt.Value, lt.Location), (Attributes) $1);
current_container.PartialContainer.AddField (current_field);
current_type.AddField (current_field);
$$ = current_field;
}
opt_field_initializer
@ -1087,7 +1087,7 @@ field_declaration @@ -1087,7 +1087,7 @@ field_declaration
current_field = new FixedField (current_type, (FullNamedExpression) $4, (Modifiers) $2,
new MemberName (lt.Value, lt.Location), (Attributes) $1);
current_container.PartialContainer.AddField (current_field);
current_type.AddField (current_field);
}
fixed_field_size opt_fixed_field_declarators SEMICOLON
{
@ -1227,7 +1227,7 @@ method_declaration @@ -1227,7 +1227,7 @@ method_declaration
// Add it early in the case of body being eof for full ast
Method m = (Method) $1;
async_block = (m.ModFlags & Modifiers.ASYNC) != 0;
current_container.PartialContainer.AddMethod (m);
current_type.AddMember (m);
}
method_body
{
@ -1678,7 +1678,7 @@ property_declaration @@ -1678,7 +1678,7 @@ property_declaration
if (type.Type != null && type.Type.Kind == MemberKind.Void)
report.Error (547, GetLocation ($3), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());
current_container.PartialContainer.AddProperty ((Property)current_property);
current_type.AddMember (current_property);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation ($6));
lexer.PropertyParsing = true;
@ -1712,7 +1712,7 @@ indexer_declaration @@ -1712,7 +1712,7 @@ indexer_declaration
current_property = indexer;
current_container.PartialContainer.AddIndexer (indexer);
current_type.AddIndexer (indexer);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation ($5), GetLocation ($8), GetLocation ($9));
if (type.Type != null && type.Type.Kind == MemberKind.Void)
@ -1988,7 +1988,7 @@ operator_declaration @@ -1988,7 +1988,7 @@ operator_declaration
}
// Note again, checking is done in semantic analysis
current_container.PartialContainer.AddOperator (op);
current_type.AddOperator (op);
lbag.AddMember (op, GetModifierLocations (), lbag.GetLocations (decl));
if ($5 == null) { // Semicolon
@ -2190,7 +2190,7 @@ constructor_declarator @@ -2190,7 +2190,7 @@ constructor_declarator
}
}
current_container.PartialContainer.AddConstructor (c);
current_type.AddConstructor (c);
lbag.AddMember (c, GetModifierLocations (), GetLocation ($5), GetLocation ($7));
$$ = c;
@ -2286,7 +2286,7 @@ destructor_declaration @@ -2286,7 +2286,7 @@ destructor_declaration
d.DocComment = ConsumeStoredComment ();
d.Block = (ToplevelBlock) $8;
current_container.PartialContainer.AddMethod (d);
current_type.AddMember (d);
lbag.AddMember (d, GetModifierLocations (), GetLocation ($3), GetLocation ($6), GetLocation ($7));
current_local_parameters = null;
@ -2299,7 +2299,7 @@ event_declaration @@ -2299,7 +2299,7 @@ event_declaration
EVENT type member_declaration_name
{
current_event_field = new EventField (current_type, (FullNamedExpression) $4, (Modifiers) $2, (MemberName) $5, (Attributes) $1);
current_container.PartialContainer.AddEvent (current_event_field);
current_type.AddMember (current_event_field);
if (current_event_field.MemberName.ExplicitInterface != null) {
report.Error (71, current_event_field.Location, "`{0}': An explicit interface implementation of an event must use property syntax",
@ -2326,7 +2326,7 @@ event_declaration @@ -2326,7 +2326,7 @@ event_declaration
OPEN_BRACE
{
current_event = new EventProperty (current_type, (FullNamedExpression) $4, (Modifiers) $2, (MemberName) $5, (Attributes) $1);
current_container.PartialContainer.AddEvent (current_event);
current_type.AddMember (current_event);
lbag.AddMember (current_event, GetModifierLocations (), GetLocation ($3), GetLocation ($6));
lexer.EventParsing = true;
@ -2649,7 +2649,7 @@ delegate_declaration @@ -2649,7 +2649,7 @@ delegate_declaration
p.CheckParameters (del);
(current_container.PartialContainer ?? current_container).AddTypeContainer (del);
current_container.AddTypeContainer (del);
current_delegate = del;
lexer.ConstraintsParsing = true;
@ -5062,9 +5062,11 @@ expression_statement @@ -5062,9 +5062,11 @@ expression_statement
}
| statement_expression COMPLETE_COMPLETION { $$ = $1; }
| statement_expression CLOSE_BRACE {
$$ = $1;
report.Error (1525, "Unexpected symbol '}', expecting ';'");
}
$$ = $1;
lbag.AddStatement ($$, GetLocation ($2));
report.Error (1525, "Unexpected symbol '}' after statement, expecting ';'");
lexer.putback ('}');
}
;
interactive_expression_statement
@ -5861,7 +5863,7 @@ from_clause @@ -5861,7 +5863,7 @@ from_clause
{
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression
expression_or_error
{
var lt = (Tokenizer.LocatedToken) $2;
var sn = new Linq.RangeVariable (lt.Value, lt.Location);
@ -5876,7 +5878,7 @@ from_clause @@ -5876,7 +5878,7 @@ from_clause
{
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression
expression_or_error
{
var lt = (Tokenizer.LocatedToken) $3;
var sn = new Linq.RangeVariable (lt.Value, lt.Location);
@ -5921,7 +5923,7 @@ select_or_group_clause @@ -5921,7 +5923,7 @@ select_or_group_clause
{
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression
expression_or_error
{
$$ = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)$3, GetLocation ($1));
@ -5936,14 +5938,14 @@ select_or_group_clause @@ -5936,14 +5938,14 @@ select_or_group_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
linq_clause_blocks.Push ((Linq.QueryBlock)current_block);
}
expression
expression_or_error
{
current_block.SetEndLocation (lexer.Location);
current_block = current_block.Parent;
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
BY expression
BY expression_or_error
{
$$ = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)$3, linq_clause_blocks.Pop (), (Expression)$6, GetLocation ($1));
lbag.AddLocation ($$, GetLocation ($5));
@ -5980,7 +5982,7 @@ let_clause @@ -5980,7 +5982,7 @@ let_clause
{
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression
expression_or_error
{
var lt = (Tokenizer.LocatedToken) $2;
var sn = new Linq.RangeVariable (lt.Value, lt.Location);
@ -5999,7 +6001,7 @@ where_clause @@ -5999,7 +6001,7 @@ where_clause
{
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression
expression_or_error
{
$$ = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)$3, GetLocation ($1));
@ -6017,7 +6019,7 @@ join_clause @@ -6017,7 +6019,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
}
expression ON
expression_or_error ON
{
current_block.SetEndLocation (lexer.Location);
current_block = current_block.Parent;
@ -6025,7 +6027,7 @@ join_clause @@ -6025,7 +6027,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
}
expression EQUALS
expression_or_error EQUALS
{
current_block.AddStatement (new ContextualReturn ((Expression) $8));
current_block.SetEndLocation (lexer.Location);
@ -6033,7 +6035,7 @@ join_clause @@ -6033,7 +6035,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression opt_join_into
expression_or_error opt_join_into
{
current_block.AddStatement (new ContextualReturn ((Expression) $11));
current_block.SetEndLocation (lexer.Location);
@ -6079,7 +6081,7 @@ join_clause @@ -6079,7 +6081,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
}
expression ON
expression_or_error ON
{
current_block.SetEndLocation (lexer.Location);
current_block = current_block.Parent;
@ -6087,7 +6089,7 @@ join_clause @@ -6087,7 +6089,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
}
expression EQUALS
expression_or_error EQUALS
{
current_block.AddStatement (new ContextualReturn ((Expression) $9));
current_block.SetEndLocation (lexer.Location);
@ -6095,7 +6097,7 @@ join_clause @@ -6095,7 +6097,7 @@ join_clause
current_block = new Linq.QueryBlock (current_block, lexer.Location);
}
expression opt_join_into
expression_or_error opt_join_into
{
current_block.AddStatement (new ContextualReturn ((Expression) $12));
current_block.SetEndLocation (lexer.Location);
@ -6293,7 +6295,7 @@ interactive_parsing @@ -6293,7 +6295,7 @@ interactive_parsing
pars,
null /* attributes */);
current_container.PartialContainer.AddMethod (method);
current_type.AddMember (method);
oob_stack.Push (method);
++lexer.parsing_block;
@ -6520,12 +6522,10 @@ void push_current_container (TypeDefinition tc, object partial_token) @@ -6520,12 +6522,10 @@ void push_current_container (TypeDefinition tc, object partial_token)
undo.AddTypeContainer (current_container, tc);
}
var main_container = current_container.PartialContainer ?? current_container;
if (partial_token != null)
main_container.AddPartial (tc);
current_container.AddPartial (tc);
else
main_container.AddTypeContainer (tc);
current_container.AddTypeContainer (tc);
++lexer.parsing_declaration;
current_container = tc;
@ -6624,6 +6624,7 @@ public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Re @@ -6624,6 +6624,7 @@ public CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Re
this.report = report;
lang_version = settings.Version;
yacc_verbose_flag = settings.VerboseParserFlag;
doc_support = settings.DocumentationFile != null;
oob_stack.Clear ();
lexer = new Tokenizer (reader, file, compiler);

46
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs

@ -73,7 +73,8 @@ namespace Mono.CSharp @@ -73,7 +73,8 @@ namespace Mono.CSharp
{
int row, column;
string value;
static LocatedToken[] buffer;
static LocatedToken[] buffer = new LocatedToken[0];
static int pos;
private LocatedToken ()
@ -129,8 +130,10 @@ namespace Mono.CSharp @@ -129,8 +130,10 @@ namespace Mono.CSharp
public static void Initialize ()
{
if (buffer == null)
#if !FULL_AST
if (buffer.Length == 0)
buffer = new LocatedToken [10000];
#endif
pos = 0;
}
@ -263,7 +266,7 @@ namespace Mono.CSharp @@ -263,7 +266,7 @@ namespace Mono.CSharp
//
static readonly KeywordEntry<int>[][] keywords;
static readonly KeywordEntry<PreprocessorDirective>[][] keywords_preprocessor;
static readonly Dictionary<string, object> keyword_strings; // TODO: HashSet
static readonly HashSet<string> keyword_strings;
static readonly NumberStyles styles;
static readonly NumberFormatInfo csharp_format_info;
@ -348,14 +351,27 @@ namespace Mono.CSharp @@ -348,14 +351,27 @@ namespace Mono.CSharp
//
Stack<int> ifstack;
static System.Text.StringBuilder string_builder;
const int max_id_size = 512;
static readonly char[] id_builder = new char [max_id_size];
public static Dictionary<char[], string>[] identifiers = new Dictionary<char[], string>[max_id_size + 1];
const int max_number_size = 512;
static char[] number_builder = new char [max_number_size];
#if FULL_AST
readonly char [] id_builder = new char [max_id_size];
Dictionary<char[], string>[] identifiers = new Dictionary<char[], string>[max_id_size + 1];
char [] number_builder = new char [max_number_size];
int number_pos;
char[] value_builder = new char[256];
#else
static readonly char [] id_builder = new char [max_id_size];
static Dictionary<char[], string>[] identifiers = new Dictionary<char[], string>[max_id_size + 1];
static char [] number_builder = new char [max_number_size];
static int number_pos;
static char[] value_builder = new char[256];
#endif
public int Line {
get {
@ -457,7 +473,7 @@ namespace Mono.CSharp @@ -457,7 +473,7 @@ namespace Mono.CSharp
static void AddKeyword (string kw, int token)
{
keyword_strings.Add (kw, null);
keyword_strings.Add (kw);
AddKeyword (keywords, kw, token);
}
@ -493,7 +509,7 @@ namespace Mono.CSharp @@ -493,7 +509,7 @@ namespace Mono.CSharp
//
static Tokenizer ()
{
keyword_strings = new Dictionary<string, object> ();
keyword_strings = new HashSet<string> ();
// 11 is the length of the longest keyword for now
keywords = new KeywordEntry<int>[11][];
@ -621,8 +637,6 @@ namespace Mono.CSharp @@ -621,8 +637,6 @@ namespace Mono.CSharp
csharp_format_info = NumberFormatInfo.InvariantInfo;
styles = NumberStyles.Float;
string_builder = new System.Text.StringBuilder ();
}
int GetKeyword (char[] id, int id_len)
@ -900,7 +914,7 @@ namespace Mono.CSharp @@ -900,7 +914,7 @@ namespace Mono.CSharp
public static bool IsKeyword (string s)
{
return keyword_strings.ContainsKey (s);
return keyword_strings.Contains (s);
}
//
@ -1780,7 +1794,7 @@ namespace Mono.CSharp @@ -1780,7 +1794,7 @@ namespace Mono.CSharp
return reader.Peek ();
}
void putback (int c)
public void putback (int c)
{
if (putback_char != -1){
Console.WriteLine ("Col: " + col);
@ -1971,7 +1985,7 @@ namespace Mono.CSharp @@ -1971,7 +1985,7 @@ namespace Mono.CSharp
char [] quotes = { '\"' };
string name = arg.Substring (pos). Trim (quotes);
string name = arg.Substring (pos).Trim (quotes);
ref_name = context.LookupFile (file_name, name);
file_name.AddIncludeFile (ref_name);
hidden = false;
@ -2078,7 +2092,7 @@ namespace Mono.CSharp @@ -2078,7 +2092,7 @@ namespace Mono.CSharp
if (c != '"')
return false;
string_builder.Length = 0;
var string_builder = new StringBuilder ();
while (c != -1 && c != '\n') {
c = get_char ();
if (c == '"') {
@ -2903,7 +2917,7 @@ namespace Mono.CSharp @@ -2903,7 +2917,7 @@ namespace Mono.CSharp
return Token.IDENTIFIER;
}
static string InternIdentifier (char[] charBuffer, int length)
string InternIdentifier (char[] charBuffer, int length)
{
//
// Keep identifiers in an array of hashtables to avoid needless

22
ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs

@ -296,7 +296,9 @@ namespace Mono.CSharp { @@ -296,7 +296,9 @@ namespace Mono.CSharp {
IsAssigned = 1 << 12, // Field is assigned
HasExplicitLayout = 1 << 13,
PartialDefinitionExists = 1 << 14, // Set when corresponding partial method definition exists
HasStructLayout = 1 << 15 // Has StructLayoutAttribute
HasStructLayout = 1 << 15, // Has StructLayoutAttribute
HasInstanceConstructor = 1 << 16,
HasUserOperators = 1 << 17
}
/// <summary>
@ -663,14 +665,22 @@ namespace Mono.CSharp { @@ -663,14 +665,22 @@ namespace Mono.CSharp {
return true;
}
//
// Does extension methods look up to find a method which matches name and extensionType.
// Search starts from this namespace and continues hierarchically up to top level.
//
public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
{
return LookupExtensionMethod (this, extensionType, name, arity);
}
var m = Parent;
do {
var ns = m as NamespaceContainer;
if (ns != null)
return ns.LookupExtensionMethod (this, extensionType, name, arity, ns, 0);
protected virtual ExtensionMethodCandidates LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity)
{
return Parent.LookupExtensionMethod (invocationContext, extensionType, name, arity);
m = m.Parent;
} while (m != null);
return null;
}
public virtual FullNamedExpression LookupNamespaceAlias (string name)

14
ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs

@ -299,8 +299,10 @@ namespace Mono.CSharp { @@ -299,8 +299,10 @@ namespace Mono.CSharp {
}
}
public override void EmitContainer ()
public override void Emit ()
{
base.Emit ();
if (ReturnType.Type != null) {
if (ReturnType.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
return_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);
@ -327,12 +329,6 @@ namespace Mono.CSharp { @@ -327,12 +329,6 @@ namespace Mono.CSharp {
BeginInvokeBuilder.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
EndInvokeBuilder.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
}
if (OptAttributes != null) {
OptAttributes.Emit ();
}
base.Emit ();
}
protected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)
@ -344,9 +340,7 @@ namespace Mono.CSharp { @@ -344,9 +340,7 @@ namespace Mono.CSharp {
protected override TypeAttributes TypeAttr {
get {
return ModifiersExtensions.TypeAttr (ModFlags, IsTopLevel) |
TypeAttributes.Class | TypeAttributes.Sealed |
base.TypeAttr;
return base.TypeAttr | TypeAttributes.Class | TypeAttributes.Sealed;
}
}

50
ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs

@ -358,5 +358,55 @@ namespace Mono.CSharp @@ -358,5 +358,55 @@ namespace Mono.CSharp
public SpecialsBag SpecialsBag { get; set; }
public object LastYYValue { get; set; }
}
//
// This is the only public entry point
//
public class CompilerCallableEntryPoint : MarshalByRefObject
{
public static bool InvokeCompiler (string [] args, TextWriter error)
{
try {
var r = new Report (new StreamReportPrinter (error));
CommandLineParser cmd = new CommandLineParser (r, error);
var setting = cmd.ParseArguments (args);
if (setting == null || r.Errors > 0)
return false;
var d = new Driver (new CompilerContext (setting, r));
return d.Compile ();
} finally {
Reset ();
}
}
public static int[] AllWarningNumbers {
get {
return Report.AllWarnings;
}
}
public static void Reset ()
{
Reset (true);
}
public static void PartialReset ()
{
Reset (false);
}
public static void Reset (bool full_flag)
{
Location.Reset ();
if (!full_flag)
return;
SymbolWriter.Reset ();
Linq.QueryBlock.TransparentParameter.Reset ();
TypeInfo.Reset ();
}
}
}

5
ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs

@ -447,7 +447,6 @@ namespace Mono.CSharp @@ -447,7 +447,6 @@ namespace Mono.CSharp
d.CreateContainer ();
d.DefineContainer ();
d.Define ();
d.Emit ();
site.AddTypeContainer (d);
del_type = new TypeExpression (d.CurrentType, loc);
@ -487,7 +486,7 @@ namespace Mono.CSharp @@ -487,7 +486,7 @@ namespace Mono.CSharp
// When site container already exists the inflated version has to be
// updated manually to contain newly created field
if (gt is InflatedTypeSpec && site_container.Fields.Count > 1) {
if (gt is InflatedTypeSpec && site_container.AnonymousMethodsCounter > 1) {
var tparams = gt.MemberDefinition.TypeParametersCount > 0 ? gt.MemberDefinition.TypeParameters : TypeParameterSpec.EmptyTypes;
var inflator = new TypeParameterInflator (module, gt, tparams, gt.TypeArguments);
gt.MemberCache.AddMember (field.InflateMember (inflator));
@ -965,7 +964,7 @@ namespace Mono.CSharp @@ -965,7 +964,7 @@ namespace Mono.CSharp
public FieldSpec CreateCallSiteField (FullNamedExpression type, Location loc)
{
int index = fields == null ? 0 : fields.Count;
int index = AnonymousMethodsCounter++;
Field f = new HoistedField (this, type, Modifiers.PUBLIC | Modifiers.STATIC, "Site" + index.ToString ("X"), null, loc);
f.Define ();

19
ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs

@ -189,8 +189,7 @@ namespace Mono.CSharp { @@ -189,8 +189,7 @@ namespace Mono.CSharp {
protected override TypeAttributes TypeAttr {
get {
return ModifiersExtensions.TypeAttr (ModFlags, IsTopLevel) |
TypeAttributes.Class | TypeAttributes.Sealed | base.TypeAttr;
return base.TypeAttr | TypeAttributes.Class | TypeAttributes.Sealed;
}
}
@ -215,7 +214,7 @@ namespace Mono.CSharp { @@ -215,7 +214,7 @@ namespace Mono.CSharp {
return;
}
AddConstant (em);
AddMember (em);
}
public static void Error_1008 (Location loc, Report Report)
@ -236,15 +235,13 @@ namespace Mono.CSharp { @@ -236,15 +235,13 @@ namespace Mono.CSharp {
protected override bool DoDefineMembers ()
{
if (constants != null) {
for (int i = 0; i < constants.Count; ++i) {
EnumMember em = (EnumMember) constants [i];
if (em.Initializer == null) {
em.Initializer = new ImplicitInitializer (em, i == 0 ? null : (EnumMember) constants[i - 1]);
}
em.Define ();
for (int i = 0; i < Members.Count; ++i) {
EnumMember em = (EnumMember) Members[i];
if (em.Initializer == null) {
em.Initializer = new ImplicitInitializer (em, i == 0 ? null : (EnumMember) Members[i - 1]);
}
em.Define ();
}
return true;

61
ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs

@ -353,8 +353,6 @@ namespace Mono.CSharp @@ -353,8 +353,6 @@ namespace Mono.CSharp
bool partial_input;
CSharpParser parser = ParseString (ParseMode.GetCompletions, input, out partial_input);
if (parser == null){
if (CSharpParser.yacc_verbose_flag != 0)
Console.WriteLine ("DEBUG: No completions available");
return null;
}
@ -372,7 +370,7 @@ namespace Mono.CSharp @@ -372,7 +370,7 @@ namespace Mono.CSharp
// Need to setup MemberCache
parser_result.CreateContainer ();
var method = parser_result.Methods[0] as Method;
var method = parser_result.Members[0] as Method;
BlockContext bc = new BlockContext (method, method.Block, ctx.BuiltinTypes.Void);
try {
@ -552,7 +550,6 @@ namespace Mono.CSharp @@ -552,7 +550,6 @@ namespace Mono.CSharp
{
partial_input = false;
Reset ();
Tokenizer.LocatedToken.Initialize ();
var enc = ctx.Settings.Encoding;
var s = new MemoryStream (enc.GetBytes (input));
@ -590,7 +587,7 @@ namespace Mono.CSharp @@ -590,7 +587,7 @@ namespace Mono.CSharp
parser.Lexer.CompleteOnEOF = true;
ReportPrinter old_printer = null;
if ((mode == ParseMode.Silent || mode == ParseMode.GetCompletions) && CSharpParser.yacc_verbose_flag == 0)
if ((mode == ParseMode.Silent || mode == ParseMode.GetCompletions))
old_printer = ctx.Report.SetPrinter (new StreamReportPrinter (TextWriter.Null));
try {
@ -651,7 +648,7 @@ namespace Mono.CSharp @@ -651,7 +648,7 @@ namespace Mono.CSharp
host.DefineContainer ();
host.Define ();
expression_method = (Method) host.Methods[0];
expression_method = (Method) host.Members[0];
} else {
expression_method = null;
}
@ -695,34 +692,36 @@ namespace Mono.CSharp @@ -695,34 +692,36 @@ namespace Mono.CSharp
var tt = assembly.Builder.GetType (host.TypeBuilder.Name);
var mi = tt.GetMethod (expression_method.MemberName.Name);
if (host.Fields != null) {
//
// We need to then go from FieldBuilder to FieldInfo
// or reflection gets confused (it basically gets confused, and variables override each
// other).
//
foreach (Field field in host.Fields) {
var fi = tt.GetField (field.Name);
Tuple<FieldSpec, FieldInfo> old;
// If a previous value was set, nullify it, so that we do
// not leak memory
if (fields.TryGetValue (field.Name, out old)) {
if (old.Item1.MemberType.IsStruct) {
//
// TODO: Clear fields for structs
//
} else {
try {
old.Item2.SetValue (null, null);
} catch {
}
//
// We need to then go from FieldBuilder to FieldInfo
// or reflection gets confused (it basically gets confused, and variables override each
// other).
//
foreach (var member in host.Members) {
var field = member as Field;
if (field == null)
continue;
var fi = tt.GetField (field.Name);
Tuple<FieldSpec, FieldInfo> old;
// If a previous value was set, nullify it, so that we do
// not leak memory
if (fields.TryGetValue (field.Name, out old)) {
if (old.Item1.MemberType.IsStruct) {
//
// TODO: Clear fields for structs
//
} else {
try {
old.Item2.SetValue (null, null);
} catch {
}
}
fields[field.Name] = Tuple.Create (field.Spec, fi);
}
fields[field.Name] = Tuple.Create (field.Spec, fi);
}
return (CompiledMethod) System.Delegate.CreateDelegate (typeof (CompiledMethod), mi);

7
ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs

@ -10265,8 +10265,11 @@ namespace Mono.CSharp @@ -10265,8 +10265,11 @@ namespace Mono.CSharp
return base.CreateExpressionTree (ec);
var init = new ArrayInitializer (parameters.Count, loc);
foreach (Property p in anonymous_type.Properties)
init.Add (new TypeOfMethod (MemberCache.GetMember (type, p.Get.Spec), loc));
foreach (var m in anonymous_type.Members) {
var p = m as Property;
if (p != null)
init.Add (new TypeOfMethod (MemberCache.GetMember (type, p.Get.Spec), loc));
}
var ctor_args = new ArrayInitializer (arguments.Count, loc);
foreach (Argument a in arguments)

11
ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs

@ -118,8 +118,7 @@ namespace Mono.CSharp @@ -118,8 +118,7 @@ namespace Mono.CSharp
declarators.Add (declarator);
// TODO: This will probably break
Parent.AddMember (this, declarator.Name.Value);
Parent.AddNameToContainer (this, declarator.Name.Value);
}
public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
@ -407,12 +406,12 @@ namespace Mono.CSharp @@ -407,12 +406,12 @@ namespace Mono.CSharp
GetSignatureForError ());
} else if (declarators != null) {
var t = new TypeExpression (MemberType, TypeExpression.Location);
int index = Parent.PartialContainer.Fields.IndexOf (this);
foreach (var d in declarators) {
var f = new FixedField (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);
f.initializer = d.Initializer;
((ConstInitializer) f.initializer).Name = d.Name.Value;
Parent.PartialContainer.Fields.Insert (++index, f);
f.Define ();
Parent.PartialContainer.Members.Add (f);
}
}
@ -645,13 +644,13 @@ namespace Mono.CSharp @@ -645,13 +644,13 @@ namespace Mono.CSharp
if (declarators != null) {
var t = new TypeExpression (MemberType, TypeExpression.Location);
int index = Parent.PartialContainer.Fields.IndexOf (this);
foreach (var d in declarators) {
var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);
if (d.Initializer != null)
f.initializer = d.Initializer;
Parent.PartialContainer.Fields.Insert (++index, f);
f.Define ();
Parent.PartialContainer.Members.Add (f);
}
}

23
ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs

@ -1213,7 +1213,6 @@ namespace Mono.CSharp @@ -1213,7 +1213,6 @@ namespace Mono.CSharp
class StructInfo
{
public readonly TypeSpec Type;
readonly List<FieldSpec> fields;
public readonly TypeInfo[] StructFields;
public readonly int Length;
@ -1223,14 +1222,13 @@ namespace Mono.CSharp @@ -1223,14 +1222,13 @@ namespace Mono.CSharp
private Dictionary<string, TypeInfo> struct_field_hash;
private Dictionary<string, int> field_hash;
protected bool InTransit;
bool InTransit;
// Private constructor. To save memory usage, we only need to create one instance
// of this class per struct type.
private StructInfo (TypeSpec type)
//
// We only need one instance per type
//
StructInfo (TypeSpec type)
{
this.Type = type;
field_type_hash.Add (type, this);
fields = MemberCache.GetAllFieldsForDefiniteAssignment (type);
@ -1327,7 +1325,7 @@ namespace Mono.CSharp @@ -1327,7 +1325,7 @@ namespace Mono.CSharp
// </summary>
public class VariableInfo {
readonly string Name;
public readonly TypeInfo TypeInfo;
readonly TypeInfo TypeInfo;
// <summary>
// The bit offset of this variable in the flow vector.
@ -1348,7 +1346,7 @@ namespace Mono.CSharp @@ -1348,7 +1346,7 @@ namespace Mono.CSharp
VariableInfo[] sub_info;
protected VariableInfo (string name, TypeSpec type, int offset)
VariableInfo (string name, TypeSpec type, int offset)
{
this.Name = name;
this.Offset = offset;
@ -1359,7 +1357,7 @@ namespace Mono.CSharp @@ -1359,7 +1357,7 @@ namespace Mono.CSharp
Initialize ();
}
protected VariableInfo (VariableInfo parent, TypeInfo type)
VariableInfo (VariableInfo parent, TypeInfo type)
{
this.Name = parent.Name;
this.TypeInfo = type;
@ -1451,6 +1449,11 @@ namespace Mono.CSharp @@ -1451,6 +1449,11 @@ namespace Mono.CSharp
return !ec.DoFlowAnalysis || ec.CurrentBranching.IsStructFieldAssigned (this, name);
}
public bool IsFullyInitialized (BlockContext bc, Location loc)
{
return TypeInfo.IsFullyInitialized (bc, this, loc);
}
public bool IsStructFieldAssigned (MyBitVector vector, string field_name)
{
int field_idx = TypeInfo.GetFieldIndex (field_name);

14
ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs

@ -187,7 +187,7 @@ namespace Mono.CSharp @@ -187,7 +187,7 @@ namespace Mono.CSharp
throw new InternalErrorException ();
this.method = method;
AddMethod (method);
Members.Add (method);
}
protected override bool DoDefineMembers ()
@ -329,7 +329,7 @@ namespace Mono.CSharp @@ -329,7 +329,7 @@ namespace Mono.CSharp
: base (host, null, new TypeExpression (host.Compiler.BuiltinTypes.Void, host.Location), Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,
new MemberName ("Dispose", host.Location))
{
host.AddMethod (this);
host.Members.Add (this);
Block.AddStatement (new DisposeMethodStatement (host.Iterator));
}
@ -494,10 +494,10 @@ namespace Mono.CSharp @@ -494,10 +494,10 @@ namespace Mono.CSharp
get_enumerator.Block.AddStatement (
new Return (new Invocation (new DynamicMethodGroupExpr (gget_enumerator, Location), null), Location));
AddMethod (get_enumerator);
AddMethod (gget_enumerator);
Members.Add (get_enumerator);
Members.Add (gget_enumerator);
} else {
AddMethod (new GetEnumeratorMethod (this, enumerator_type, name));
Members.Add (new GetEnumeratorMethod (this, enumerator_type, name));
}
}
@ -526,7 +526,7 @@ namespace Mono.CSharp @@ -526,7 +526,7 @@ namespace Mono.CSharp
current.Get = new Property.GetMethod (current, 0, null, Location);
current.Get.Block = get_block;
AddProperty (current);
Members.Add (current);
}
void Define_Reset ()
@ -536,7 +536,7 @@ namespace Mono.CSharp @@ -536,7 +536,7 @@ namespace Mono.CSharp
Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,
new MemberName ("Reset", Location),
ParametersCompiled.EmptyReadOnlyParameters, null);
AddMethod (reset);
Members.Add (reset);
reset.Block = new ToplevelBlock (Compiler, Location);

2
ICSharpCode.NRefactory.CSharp/Parser/mcs/linq.cs

@ -850,7 +850,7 @@ namespace Mono.CSharp.Linq @@ -850,7 +850,7 @@ namespace Mono.CSharp.Linq
public void AddRangeVariable (RangeVariable variable)
{
variable.Block = this;
AddLocalName (variable.Name, variable);
TopBlock.AddLocalName (variable.Name, variable, true);
}
public override void Error_AlreadyDeclared (string name, INamedBlockVariable variable, string reason)

7
ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs

@ -220,7 +220,7 @@ namespace Mono.CSharp { @@ -220,7 +220,7 @@ namespace Mono.CSharp {
static Checkpoint [] checkpoints;
static int checkpoint_index;
public readonly static Location Null = new Location (-1);
public readonly static Location Null = new Location ();
public static bool InEmacs;
static Location ()
@ -269,11 +269,6 @@ namespace Mono.CSharp { @@ -269,11 +269,6 @@ namespace Mono.CSharp {
// File is always pushed before being changed.
}
public Location (int row)
: this (row, 0)
{
}
public Location (int row, int column)
{
if (row <= 0)

2
ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs

@ -894,7 +894,7 @@ namespace Mono.CSharp { @@ -894,7 +894,7 @@ namespace Mono.CSharp {
return IndexerNameAlias;
if (mc is Constructor)
return Constructor.ConstructorName;
return mc.IsStatic ? Constructor.TypeConstructorName : Constructor.ConstructorName;
return mc.MemberName.Name;
}

19
ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs

@ -1361,10 +1361,6 @@ namespace Mono.CSharp { @@ -1361,10 +1361,6 @@ namespace Mono.CSharp {
public override bool EnableOverloadChecks (MemberCore overload)
{
// TODO: It can be deleted when members will be defined in correct order
if (overload is Operator)
return overload.EnableOverloadChecks (this);
if (overload is Indexer)
return false;
@ -1619,6 +1615,9 @@ namespace Mono.CSharp { @@ -1619,6 +1615,9 @@ namespace Mono.CSharp {
return false;
}
if ((caching_flags & Flags.MethodOverloadsExist) != 0)
Parent.MemberCache.CheckExistingMembersOverloads (this, parameters);
// the rest can be ignored
return true;
}
@ -1649,14 +1648,6 @@ namespace Mono.CSharp { @@ -1649,14 +1648,6 @@ namespace Mono.CSharp {
if (ConstructorBuilder != null)
return true;
var ca = MethodAttributes.RTSpecialName | MethodAttributes.SpecialName;
if ((ModFlags & Modifiers.STATIC) != 0) {
ca |= MethodAttributes.Static | MethodAttributes.Private;
} else {
ca |= ModifiersExtensions.MethodAttr (ModFlags);
}
if (!CheckAbstractAndExtern (block != null))
return false;
@ -1664,6 +1655,8 @@ namespace Mono.CSharp { @@ -1664,6 +1655,8 @@ namespace Mono.CSharp {
if (!CheckBase ())
return false;
var ca = ModifiersExtensions.MethodAttr (ModFlags) | MethodAttributes.RTSpecialName | MethodAttributes.SpecialName;
ConstructorBuilder = Parent.TypeBuilder.DefineConstructor (
ca, CallingConventions,
parameters.GetMetaInfo ());
@ -1906,12 +1899,10 @@ namespace Mono.CSharp { @@ -1906,12 +1899,10 @@ namespace Mono.CSharp {
public MethodData (InterfaceMemberBase member,
Modifiers modifiers, MethodAttributes flags,
IMethodData method, MethodBuilder builder,
//GenericMethod generic,
MethodSpec parent_method)
: this (member, modifiers, flags, method)
{
this.builder = builder;
//this.GenericMethod = generic;
this.parent_method = parent_method;
}

10
ICSharpCode.NRefactory.CSharp/Parser/mcs/module.cs

@ -39,7 +39,7 @@ namespace Mono.CSharp @@ -39,7 +39,7 @@ namespace Mono.CSharp
sealed class StaticDataContainer : CompilerGeneratedClass
{
readonly Dictionary<int, Struct> size_types;
new int fields;
int fields;
public StaticDataContainer (ModuleContainer module)
: base (module, new MemberName ("<PrivateImplementationDetails>" + module.builder.ModuleVersionId.ToString ("B"), Location.Null), Modifiers.STATIC)
@ -180,6 +180,11 @@ namespace Mono.CSharp @@ -180,6 +180,11 @@ namespace Mono.CSharp
}
}
public int CounterAnonymousTypes { get; set; }
public int CounterAnonymousMethods { get; set; }
public int CounterAnonymousContainers { get; set; }
public int CounterSwitchTypes { get; set; }
public AssemblyDefinition DeclaringAssembly {
get {
return assembly;
@ -423,7 +428,8 @@ namespace Mono.CSharp @@ -423,7 +428,8 @@ namespace Mono.CSharp
base.EmitContainer ();
VerifyMembers ();
if (Compiler.Report.Errors == 0)
VerifyMembers ();
if (anonymous_types != null) {
foreach (var atypes in anonymous_types)

70
ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs

@ -83,6 +83,7 @@ namespace Mono.CSharp { @@ -83,6 +83,7 @@ namespace Mono.CSharp {
string fullname;
protected Dictionary<string, Namespace> namespaces;
protected Dictionary<string, IList<TypeSpec>> types;
List<TypeSpec> extension_method_types;
Dictionary<string, TypeExpr> cached_types;
RootNamespace root;
bool cls_checked;
@ -403,27 +404,35 @@ namespace Mono.CSharp { @@ -403,27 +404,35 @@ namespace Mono.CSharp {
//
public List<MethodSpec> LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity)
{
if (types == null)
if (extension_method_types == null)
return null;
List<MethodSpec> found = null;
for (int i = 0; i < extension_method_types.Count; ++i) {
var ts = extension_method_types[i];
// TODO: Add per namespace flag when at least 1 type has extension
//
// When the list was built we didn't know what members the type
// contains
//
if ((ts.Modifiers & Modifiers.METHOD_EXTENSION) == 0) {
if (extension_method_types.Count == 1) {
extension_method_types = null;
return found;
}
foreach (var tgroup in types.Values) {
foreach (var ts in tgroup) {
if ((ts.Modifiers & Modifiers.METHOD_EXTENSION) == 0)
continue;
extension_method_types.RemoveAt (i--);
continue;
}
var res = ts.MemberCache.FindExtensionMethods (invocationContext, extensionType, name, arity);
if (res == null)
continue;
var res = ts.MemberCache.FindExtensionMethods (invocationContext, extensionType, name, arity);
if (res == null)
continue;
if (found == null) {
found = res;
} else {
found.AddRange (res);
}
if (found == null) {
found = res;
} else {
found.AddRange (res);
}
}
@ -436,6 +445,14 @@ namespace Mono.CSharp { @@ -436,6 +445,14 @@ namespace Mono.CSharp {
types = new Dictionary<string, IList<TypeSpec>> (64);
}
if (ts.IsStatic && ts.Arity == 0 &&
(ts.MemberDefinition.DeclaringAssembly == null || ts.MemberDefinition.DeclaringAssembly.HasExtensionMethod)) {
if (extension_method_types == null)
extension_method_types = new List<TypeSpec> ();
extension_method_types.Add (ts);
}
var name = ts.Name;
IList<TypeSpec> existing;
if (types.TryGetValue (name, out existing)) {
@ -604,10 +621,12 @@ namespace Mono.CSharp { @@ -604,10 +621,12 @@ namespace Mono.CSharp {
Namespace[] namespace_using_table;
Dictionary<string, UsingAliasNamespace> aliases;
public readonly MemberName RealMemberName;
public NamespaceContainer (MemberName name, ModuleContainer module, NamespaceContainer parent, CompilationSourceFile sourceFile)
: base ((TypeContainer) parent ?? module, name, null, MemberKind.Namespace)
{
this.RealMemberName = name;
this.module = module;
this.Parent = parent;
this.file = sourceFile;
@ -761,15 +780,6 @@ namespace Mono.CSharp { @@ -761,15 +780,6 @@ namespace Mono.CSharp {
base.EmitContainer ();
}
//
// Does extension methods look up to find a method which matches name and extensionType.
// Search starts from this namespace and continues hierarchically up to top level.
//
protected override ExtensionMethodCandidates LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity)
{
return LookupExtensionMethod (invocationContext, extensionType, name, arity, this, 0);
}
public ExtensionMethodCandidates LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity, NamespaceContainer container, int position)
{
//
@ -1180,10 +1190,10 @@ namespace Mono.CSharp { @@ -1180,10 +1190,10 @@ namespace Mono.CSharp {
return MemberName == null ? "global::" : base.GetSignatureForError ();
}
public override void RemoveContainer (TypeContainer next_part)
public override void RemoveContainer (TypeContainer cont)
{
base.RemoveContainer (next_part);
NS.RemoveContainer (next_part);
base.RemoveContainer (cont);
NS.RemoveContainer (cont);
}
protected override bool VerifyClsCompliance ()
@ -1265,7 +1275,7 @@ namespace Mono.CSharp { @@ -1265,7 +1275,7 @@ namespace Mono.CSharp {
}
}
public void Accept (StructuralVisitor visitor)
public virtual void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}
@ -1288,7 +1298,7 @@ namespace Mono.CSharp { @@ -1288,7 +1298,7 @@ namespace Mono.CSharp {
}
}
public void Accept (StructuralVisitor visitor)
public override void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}
@ -1422,7 +1432,7 @@ namespace Mono.CSharp { @@ -1422,7 +1432,7 @@ namespace Mono.CSharp {
resolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx));
}
public void Accept (StructuralVisitor visitor)
public override void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}

24
ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs

@ -445,7 +445,7 @@ namespace Mono.CSharp @@ -445,7 +445,7 @@ namespace Mono.CSharp
if (first == null)
first = value;
Parent.AddMember (get);
Parent.AddNameToContainer (get, get.MemberName.Basename);
}
}
@ -458,7 +458,7 @@ namespace Mono.CSharp @@ -458,7 +458,7 @@ namespace Mono.CSharp
if (first == null)
first = value;
Parent.AddMember (set);
Parent.AddNameToContainer (set, set.MemberName.Basename);
}
}
@ -743,7 +743,7 @@ namespace Mono.CSharp @@ -743,7 +743,7 @@ namespace Mono.CSharp
if (!field.Define ())
return;
Parent.PartialContainer.AddField (field);
Parent.PartialContainer.Members.Add (field);
FieldExpr fe = new FieldExpr (field, Location);
if ((field.ModFlags & Modifiers.STATIC) == 0)
@ -787,7 +787,7 @@ namespace Mono.CSharp @@ -787,7 +787,7 @@ namespace Mono.CSharp
else
pm = new GetMethod (this, 0, null, Location);
Parent.AddMember (pm);
Parent.AddNameToContainer (pm, pm.MemberName.Basename);
}
if (!CheckBase ())
@ -1040,8 +1040,7 @@ namespace Mono.CSharp @@ -1040,8 +1040,7 @@ namespace Mono.CSharp
declarators.Add (declarator);
// TODO: This will probably break
Parent.AddMember (this, declarator.Name.Value);
Parent.AddNameToContainer (this, declarator.Name.Value);
}
public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
@ -1074,14 +1073,14 @@ namespace Mono.CSharp @@ -1074,14 +1073,14 @@ namespace Mono.CSharp
mod_flags_src &= ~(Modifiers.AccessibilityMask | Modifiers.DEFAULT_ACCESS_MODIFER);
var t = new TypeExpression (MemberType, TypeExpression.Location);
int index = Parent.PartialContainer.Events.IndexOf (this);
foreach (var d in declarators) {
var ef = new EventField (Parent, t, mod_flags_src, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);
if (d.Initializer != null)
ef.initializer = d.Initializer;
Parent.PartialContainer.Events.Insert (++index, ef);
ef.Define ();
Parent.PartialContainer.Members.Add (ef);
}
}
@ -1098,7 +1097,7 @@ namespace Mono.CSharp @@ -1098,7 +1097,7 @@ namespace Mono.CSharp
Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
MemberName, null);
Parent.PartialContainer.AddField (backing_field);
Parent.PartialContainer.Members.Add (backing_field);
backing_field.Initializer = Initializer;
backing_field.ModFlags &= ~Modifiers.COMPILER_GENERATED;
@ -1238,7 +1237,7 @@ namespace Mono.CSharp @@ -1238,7 +1237,7 @@ namespace Mono.CSharp
}
set {
add = value;
Parent.AddMember (value);
Parent.AddNameToContainer (value, value.MemberName.Basename);
}
}
@ -1254,7 +1253,7 @@ namespace Mono.CSharp @@ -1254,7 +1253,7 @@ namespace Mono.CSharp
}
set {
remove = value;
Parent.AddMember (value);
Parent.AddNameToContainer (value, value.MemberName.Basename);
}
}
#endregion
@ -1572,8 +1571,7 @@ namespace Mono.CSharp @@ -1572,8 +1571,7 @@ namespace Mono.CSharp
}
}
if (!Parent.PartialContainer.AddMember (this))
return false;
Parent.AddNameToContainer (this, MemberName.Basename);
flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;

3
ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs

@ -133,6 +133,7 @@ namespace Mono.CSharp { @@ -133,6 +133,7 @@ namespace Mono.CSharp {
// Compiler debug flags only
public bool ParseOnly, TokenizeOnly, Timestamps;
public int DebugFlags;
public int VerboseParserFlag;
//
// Whether we are being linked against the standard libraries.
@ -1095,7 +1096,7 @@ namespace Mono.CSharp { @@ -1095,7 +1096,7 @@ namespace Mono.CSharp {
{
switch (arg){
case "-v":
CSharpParser.yacc_verbose_flag++;
settings.VerboseParserFlag++;
return ParseResult.Success;
case "--version":

32
ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs

@ -1912,7 +1912,7 @@ namespace Mono.CSharp { @@ -1912,7 +1912,7 @@ namespace Mono.CSharp {
if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (VariableInfo))
return true;
return VariableInfo.TypeInfo.IsFullyInitialized (ec, VariableInfo, block.StartLocation);
return VariableInfo.IsFullyInitialized (ec, block.StartLocation);
}
public bool IsAssigned (BlockContext ec)
@ -2099,9 +2099,9 @@ namespace Mono.CSharp { @@ -2099,9 +2099,9 @@ namespace Mono.CSharp {
AddLocalName (li.Name, li);
}
public virtual void AddLocalName (string name, INamedBlockVariable li)
public void AddLocalName (string name, INamedBlockVariable li)
{
ParametersBlock.TopBlock.AddLocalName (name, li);
ParametersBlock.TopBlock.AddLocalName (name, li, false);
}
public virtual void Error_AlreadyDeclared (string name, INamedBlockVariable variable, string reason)
@ -3003,7 +3003,7 @@ namespace Mono.CSharp { @@ -3003,7 +3003,7 @@ namespace Mono.CSharp {
}
}
public override void AddLocalName (string name, INamedBlockVariable li)
public void AddLocalName (string name, INamedBlockVariable li, bool ignoreChildrenBlocks)
{
if (names == null)
names = new Dictionary<string, object> ();
@ -3047,13 +3047,15 @@ namespace Mono.CSharp { @@ -3047,13 +3047,15 @@ namespace Mono.CSharp {
}
}
// Collision with with children
b = existing.Block;
while ((b = b.Parent) != null) {
if (li.Block == b) {
li.Block.Error_AlreadyDeclared (name, li, "child");
i = existing_list.Count;
break;
if (!ignoreChildrenBlocks) {
// Collision with children
b = existing.Block;
while ((b = b.Parent) != null) {
if (li.Block == b) {
li.Block.Error_AlreadyDeclared (name, li, "child");
i = existing_list.Count;
break;
}
}
}
}
@ -3551,7 +3553,6 @@ namespace Mono.CSharp { @@ -3551,7 +3553,6 @@ namespace Mono.CSharp {
VariableReference value;
ExpressionStatement string_dictionary;
FieldExpr switch_cache_field;
static int unique_counter;
ExplicitBlock block;
//
@ -3912,11 +3913,6 @@ namespace Mono.CSharp { @@ -3912,11 +3913,6 @@ namespace Mono.CSharp {
return null;
}
public static void Reset ()
{
unique_counter = 0;
}
public override bool Resolve (BlockContext ec)
{
Expr = Expr.Resolve (ec);
@ -4089,7 +4085,7 @@ namespace Mono.CSharp { @@ -4089,7 +4085,7 @@ namespace Mono.CSharp {
var ctype = ec.CurrentMemberDefinition.Parent.PartialContainer;
Field field = new Field (ctype, string_dictionary_type,
Modifiers.STATIC | Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED,
new MemberName (CompilerGeneratedClass.MakeName (null, "f", "switch$map", unique_counter++), loc), null);
new MemberName (CompilerGeneratedClass.MakeName (null, "f", "switch$map", ec.Module.CounterSwitchTypes++), loc), null);
if (!field.Define ())
return;
ctype.AddField (field);

18
ICSharpCode.NRefactory.CSharp/Parser/mcs/visit.cs

@ -29,19 +29,15 @@ namespace Mono.CSharp @@ -29,19 +29,15 @@ namespace Mono.CSharp
}
void VisitTypeContainer (TypeContainer tc)
void VisitTypeDefinition (TypeDefinition tc)
{
if (tc.Containers == null)
return;
foreach (var container in tc.Containers) {
if (container != null)
container.Accept (this);
foreach (var container in tc.Members) {
container.Accept (this);
}
}
public virtual void Visit (NamespaceContainer ns)
{
VisitTypeContainer (ns);
}
public virtual void Visit (UsingNamespace un)
@ -58,18 +54,18 @@ namespace Mono.CSharp @@ -58,18 +54,18 @@ namespace Mono.CSharp
public virtual void Visit (Class c)
{
VisitTypeContainer (c);
VisitTypeDefinition (c);
}
public virtual void Visit (Struct s)
{
VisitTypeContainer (s);
VisitTypeDefinition (s);
}
public virtual void Visit (Interface i)
{
VisitTypeContainer (i);
VisitTypeDefinition (i);
}
public virtual void Visit (Delegate d)
@ -78,7 +74,7 @@ namespace Mono.CSharp @@ -78,7 +74,7 @@ namespace Mono.CSharp
public virtual void Visit (Enum e)
{
VisitTypeContainer (e);
VisitTypeDefinition (e);
}
public virtual void Visit (FixedField f)

Loading…
Cancel
Save