Open
Description
This story is about cleaning up the declarations. Please comment on and extend the design until we are sure it will work before implementing.
So far, I have this system:
public abstract class SyntaxNode
{
public ParserNodeContext { get; set; } // Define the qualified selection on the context
public SyntaxNode Parent { get; set; }
}
public abstract class DeclarationSyntaxNode
{
public List<IdentifierReference> References { get; set; }
public VBAParser.AsTypeClauseContext AsTypeContext { get; set;}
public Accessibility Accessibility { get; set; }
public bool IsUndeclared { get; set; }
public string IdentifierName
}
public class ModuleSyntax : DeclarationSyntaxNode
{
public List<SyntaxNode> ChildDeclarations { get; set; }
}
public class MemberSyntax : DeclarationSyntaxNode
{
List<ParameterSyntax> Parameters { get; set; }
}
public class VariableSyntax : DeclarationSyntaxNode
{
// variable, field
}
public class ParameterSyntax : DeclarationSyntaxNode
{
public PassByModifier PassByModifier { get; set; } // implicit, byval, byref
}
public abstract class StatementSyntaxNode
{
// todo: eventually implement a bunch of these for assignments, comparisons, etc.
// to make it easier than mucking around with the ANTLR parse tree
// bye bye, handling whitespace and line continuations :)
}