Browse Source

Worked on merging mcs.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
d9fe4a3566
  1. 1
      ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs
  3. 1294
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs
  4. 12
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay
  5. 15
      ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs
  6. 18
      ICSharpCode.NRefactory.CSharp/Parser/mcs/visit.cs

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

@ -3295,6 +3295,7 @@ namespace ICSharpCode.NRefactory.CSharp
public CSharpParser () public CSharpParser ()
{ {
CompilerSettings = new CompilerSettings (); CompilerSettings = new CompilerSettings ();
CompilerSettings.Unsafe = true;
} }
public CSharpParser (CompilerSettings args) public CSharpParser (CompilerSettings args)

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

@ -338,10 +338,8 @@ namespace Mono.CSharp
public virtual void RemoveContainer (TypeContainer next_part) public virtual void RemoveContainer (TypeContainer next_part)
{ {
if (containers != null) { if (containers != null)
Console.WriteLine ("remove :"+ next_part);
containers.Remove (next_part); containers.Remove (next_part);
}
defined_names.Remove (next_part.Basename); defined_names.Remove (next_part.Basename);
} }

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

File diff suppressed because it is too large Load Diff

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

@ -957,7 +957,11 @@ struct_declaration
} }
opt_semicolon opt_semicolon
{ {
if ($16 == null) {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14));
} else {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16)); lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16));
}
$$ = pop_current_class (); $$ = pop_current_class ();
} }
| opt_attributes opt_modifiers opt_partial STRUCT error | opt_attributes opt_modifiers opt_partial STRUCT error
@ -1906,7 +1910,11 @@ interface_declaration
} }
opt_semicolon opt_semicolon
{ {
if ($15 == null) {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
} else {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15)); lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
}
$$ = pop_current_class (); $$ = pop_current_class ();
} }
| opt_attributes opt_modifiers opt_partial INTERFACE error | opt_attributes opt_modifiers opt_partial INTERFACE error
@ -4329,7 +4337,11 @@ class_declaration
} }
opt_semicolon opt_semicolon
{ {
if ($15 == null) {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
} else {
lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15)); lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
}
$$ = pop_current_class (); $$ = pop_current_class ();
} }
; ;

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

@ -1264,6 +1264,11 @@ namespace Mono.CSharp {
} }
} }
} }
public void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}
} }
public class UsingExternAlias : UsingAliasNamespace public class UsingExternAlias : UsingAliasNamespace
@ -1282,6 +1287,11 @@ namespace Mono.CSharp {
Alias.Value); Alias.Value);
} }
} }
public void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}
} }
public class UsingAliasNamespace : UsingNamespace public class UsingAliasNamespace : UsingNamespace
@ -1411,5 +1421,10 @@ namespace Mono.CSharp {
// //
resolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx)); resolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx));
} }
public void Accept (StructuralVisitor visitor)
{
visitor.Visit (this);
}
} }
} }

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

@ -31,6 +31,12 @@ namespace Mono.CSharp
void VisitTypeContainer (TypeContainer tc) void VisitTypeContainer (TypeContainer tc)
{ {
if (tc.Containers == null)
return;
foreach (var container in tc.Containers) {
if (container != null)
container.Accept (this);
}
} }
public virtual void Visit (NamespaceContainer ns) public virtual void Visit (NamespaceContainer ns)
@ -38,6 +44,18 @@ namespace Mono.CSharp
VisitTypeContainer (ns); VisitTypeContainer (ns);
} }
public virtual void Visit (UsingNamespace un)
{
}
public virtual void Visit (UsingAliasNamespace uan)
{
}
public virtual void Visit (UsingExternAlias uea)
{
}
public virtual void Visit (Class c) public virtual void Visit (Class c)
{ {
VisitTypeContainer (c); VisitTypeContainer (c);

Loading…
Cancel
Save