public override void Visit(SyntaxNode node) { ConvertedSyntaxKind kind = node.Kind.ConvertToLocalType(); switch (kind) { case ConvertedSyntaxKind.TableObject: this.ProjectTypesInformation.Add(new TableTypeInformation((TableSyntax)node)); break; case ConvertedSyntaxKind.PageObject: case ConvertedSyntaxKind.PageExtensionObject: case ConvertedSyntaxKind.TableExtensionObject: case ConvertedSyntaxKind.ReportObject: case ConvertedSyntaxKind.XmlPortObject: case ConvertedSyntaxKind.CodeunitObject: case ConvertedSyntaxKind.EnumType: case ConvertedSyntaxKind.EnumExtensionType: case ConvertedSyntaxKind.ProfileObject: case ConvertedSyntaxKind.PageCustomizationObject: case ConvertedSyntaxKind.Interface: break; default: base.Visit(node); break; } }
protected void ProcessPageGroupNode(dynamic syntaxTree, ALSymbolInformation symbol, dynamic syntax) { dynamic controlKeywordToken = syntax.ControlKeyword; if (controlKeywordToken != null) { ConvertedSyntaxKind controlKind = ALEnumConverters.SyntaxKindConverter.Convert(controlKeywordToken.Kind); if (controlKind == ConvertedSyntaxKind.PageRepeaterKeyword) { symbol.kind = ALSymbolKind.PageRepeater; } } this.ProcessNodeContentRange(syntaxTree, symbol, syntax); }
protected bool VisitNode(SyntaxNode node) { ConvertedSyntaxKind kind = node.Kind.ConvertToLocalType(); switch (kind) { case ConvertedSyntaxKind.TableObject: this.ProjectTypesInformation.Add(new TableTypeInformation((TableSyntax)node)); break; case ConvertedSyntaxKind.CompilationUnit: return(true); } return(false); }
protected bool ProcessSyntaxNodeAttribute(dynamic syntaxTree, ALSymbolInformation parent, dynamic node) { ConvertedSyntaxKind kind = ALEnumConverters.SyntaxKindConverter.Convert(node.Kind); switch (kind) { case ConvertedSyntaxKind.PropertyList: this.ProcessSyntaxNodePropertyList(syntaxTree, parent, node); return(true); case ConvertedSyntaxKind.SimpleTypeReference: case ConvertedSyntaxKind.RecordTypeReference: case ConvertedSyntaxKind.DotNetTypeReference: parent.subtype = node.ToFullString(); return(true); case ConvertedSyntaxKind.MemberAttribute: string memberAttributeName = node.Name.ToString(); if ((parent.kind == ALSymbolKind.MethodDeclaration) || (parent.kind == ALSymbolKind.LocalMethodDeclaration)) { ALSymbolKind newKind = ALSyntaxHelper.MemberAttributeToMethodKind(memberAttributeName); if (newKind != ALSymbolKind.Undefined) { parent.kind = newKind; return(true); } } parent.subtype = memberAttributeName; return(true); case ConvertedSyntaxKind.ObjectId: if ((node.Value != null) && (node.Value.Value != null)) { parent.id = node.Value.Value; } return(true); case ConvertedSyntaxKind.IdentifierName: dynamic lineSpan = syntaxTree.GetLineSpan(node.Span); parent.selectionRange = new Range(lineSpan.StartLinePosition.Line, lineSpan.StartLinePosition.Character, lineSpan.EndLinePosition.Line, lineSpan.EndLinePosition.Character); return(true); } return(false); }
protected void ProcessSyntaxNodePropertyList(dynamic syntaxTree, ALSymbolInformation parent, dynamic node) { IEnumerable <dynamic> list = node.ChildNodes(); if (list != null) { foreach (dynamic childNode in list) { ConvertedSyntaxKind kind = ALEnumConverters.SyntaxKindConverter.Convert(childNode.Kind); if (kind == ConvertedSyntaxKind.Property) { string name = (childNode.Name != null)?childNode.Name.ToString():""; string value = (childNode.Value != null)?childNode.Value.ToString():""; this.ProcessSyntaxNodeProperty(syntaxTree, parent, name, value); } } } }
private ALSymbolKind GetKind(SyntaxNode node) { ConvertedSyntaxKind kind = node.Kind.ConvertToLocalType(); switch (kind) { case ConvertedSyntaxKind.TriggerDeclaration: return(ALSymbolKind.TriggerDeclaration); case ConvertedSyntaxKind.MethodDeclaration: MethodDeclarationSyntax methodNode = node as MethodDeclarationSyntax; foreach (MemberAttributeSyntax att in methodNode.Attributes) { ALSymbolKind alKind = ALSyntaxHelper.MemberAttributeToMethodKind(att.GetNameStringValue()); if (alKind != ALSymbolKind.Undefined) { return(alKind); } } return(ALSymbolKind.MethodDeclaration); } return(ALSymbolKind.Undefined); }
protected ALSymbolKind SyntaxKindToALSymbolKind(dynamic node) { Type nodeType = null; ConvertedSyntaxKind kind = ALEnumConverters.SyntaxKindConverter.Convert(node.Kind); switch (kind) { //file root case ConvertedSyntaxKind.CompilationUnit: return(ALSymbolKind.CompilationUnit); //object types case ConvertedSyntaxKind.CodeunitObject: return(ALSymbolKind.CodeunitObject); case ConvertedSyntaxKind.TableObject: return(ALSymbolKind.TableObject); case ConvertedSyntaxKind.TableExtensionObject: return(ALSymbolKind.TableExtensionObject); case ConvertedSyntaxKind.PageObject: return(ALSymbolKind.PageObject); case ConvertedSyntaxKind.PageExtensionObject: return(ALSymbolKind.PageExtensionObject); case ConvertedSyntaxKind.ReportObject: return(ALSymbolKind.ReportObject); case ConvertedSyntaxKind.XmlPortObject: return(ALSymbolKind.XmlPortObject); case ConvertedSyntaxKind.QueryObject: return(ALSymbolKind.QueryObject); case ConvertedSyntaxKind.ControlAddInObject: return(ALSymbolKind.ControlAddInObject); case ConvertedSyntaxKind.ProfileObject: return(ALSymbolKind.ProfileObject); case ConvertedSyntaxKind.PageCustomizationObject: return(ALSymbolKind.PageCustomizationObject); case ConvertedSyntaxKind.DotNetPackage: return(ALSymbolKind.DotNetPackage); //code elements case ConvertedSyntaxKind.MethodDeclaration: nodeType = node.GetType(); if ((nodeType.GetProperty("LocalKeyword") != null) && (node.LocalKeyword != null) && (ALEnumConverters.SyntaxKindConverter.Convert(node.LocalKeyword.Kind) != ConvertedSyntaxKind.None)) { return(ALSymbolKind.LocalMethodDeclaration); } else if ((nodeType.GetProperty("AccessModifier") != null) && (node.AccessModifier != null)) { ConvertedSyntaxKind modifiedKind = ALEnumConverters.SyntaxKindConverter.Convert(node.AccessModifier.Kind); switch (modifiedKind) { case ConvertedSyntaxKind.ProtectedKeyword: return(ALSymbolKind.LocalMethodDeclaration); case ConvertedSyntaxKind.LocalKeyword: return(ALSymbolKind.LocalMethodDeclaration); case ConvertedSyntaxKind.InternalKeyword: return(ALSymbolKind.LocalMethodDeclaration); default: return(ALSymbolKind.MethodDeclaration); } } else { return(ALSymbolKind.MethodDeclaration); } case ConvertedSyntaxKind.ParameterList: return(ALSymbolKind.ParameterList); case ConvertedSyntaxKind.Parameter: return(ALSymbolKind.Parameter); case ConvertedSyntaxKind.VarSection: return(ALSymbolKind.VarSection); case ConvertedSyntaxKind.VariableDeclaration: return(ALSymbolKind.VariableDeclaration); case ConvertedSyntaxKind.TriggerDeclaration: return(ALSymbolKind.TriggerDeclaration); //table and table extensions case ConvertedSyntaxKind.FieldList: return(ALSymbolKind.FieldList); case ConvertedSyntaxKind.Field: return(ALSymbolKind.Field); case ConvertedSyntaxKind.DotNetAssembly: return(ALSymbolKind.DotNetAssembly); case ConvertedSyntaxKind.DotNetTypeDeclaration: return(ALSymbolKind.DotNetTypeDeclaration); case ConvertedSyntaxKind.FieldExtensionList: return(ALSymbolKind.FieldExtensionList); case ConvertedSyntaxKind.FieldModification: return(ALSymbolKind.FieldModification); case ConvertedSyntaxKind.KeyList: return(ALSymbolKind.KeyList); case ConvertedSyntaxKind.Key: return(ALSymbolKind.Key); case ConvertedSyntaxKind.FieldGroupList: return(ALSymbolKind.FieldGroupList); case ConvertedSyntaxKind.FieldGroup: return(ALSymbolKind.FieldGroup); //page, page extenstions and page customizations case ConvertedSyntaxKind.PageLayout: return(ALSymbolKind.PageLayout); case ConvertedSyntaxKind.PageActionList: return(ALSymbolKind.PageActionList); case ConvertedSyntaxKind.GroupActionList: return(ALSymbolKind.GroupActionList); case ConvertedSyntaxKind.PageArea: return(ALSymbolKind.PageArea); case ConvertedSyntaxKind.PageGroup: return(ALSymbolKind.PageGroup); case ConvertedSyntaxKind.PageField: return(ALSymbolKind.PageField); case ConvertedSyntaxKind.PageLabel: return(ALSymbolKind.PageLabel); case ConvertedSyntaxKind.PagePart: return(ALSymbolKind.PagePart); case ConvertedSyntaxKind.PageSystemPart: return(ALSymbolKind.PageSystemPart); case ConvertedSyntaxKind.PageChartPart: return(ALSymbolKind.PageChartPart); case ConvertedSyntaxKind.PageUserControl: return(ALSymbolKind.PageUserControl); case ConvertedSyntaxKind.PageAction: return(ALSymbolKind.PageAction); case ConvertedSyntaxKind.PageActionGroup: return(ALSymbolKind.PageActionGroup); case ConvertedSyntaxKind.PageActionArea: return(ALSymbolKind.PageActionArea); case ConvertedSyntaxKind.PageActionSeparator: return(ALSymbolKind.PageActionSeparator); case ConvertedSyntaxKind.PageExtensionActionList: return(ALSymbolKind.PageExtensionActionList); case ConvertedSyntaxKind.ActionAddChange: return(ALSymbolKind.ActionAddChange); case ConvertedSyntaxKind.ActionMoveChange: return(ALSymbolKind.ActionMoveChange); case ConvertedSyntaxKind.ActionModifyChange: return(ALSymbolKind.ActionModifyChange); case ConvertedSyntaxKind.PageExtensionLayout: return(ALSymbolKind.PageExtensionLayout); case ConvertedSyntaxKind.ControlAddChange: return(ALSymbolKind.ControlAddChange); case ConvertedSyntaxKind.ControlMoveChange: return(ALSymbolKind.ControlMoveChange); case ConvertedSyntaxKind.ControlModifyChange: return(ALSymbolKind.ControlModifyChange); case ConvertedSyntaxKind.PageExtensionViewList: return(ALSymbolKind.PageExtensionViewList); case ConvertedSyntaxKind.ViewAddChange: return(ALSymbolKind.ViewAddChange); case ConvertedSyntaxKind.ViewMoveChange: return(ALSymbolKind.ViewMoveChange); case ConvertedSyntaxKind.ViewModifyChange: return(ALSymbolKind.ViewModifyChange); case ConvertedSyntaxKind.PageViewList: return(ALSymbolKind.PageViewList); case ConvertedSyntaxKind.PageView: return(ALSymbolKind.PageView); //xmlports case ConvertedSyntaxKind.XmlPortSchema: return(ALSymbolKind.XmlPortSchema); case ConvertedSyntaxKind.XmlPortTableElement: return(ALSymbolKind.XmlPortTableElement); case ConvertedSyntaxKind.XmlPortFieldElement: return(ALSymbolKind.XmlPortFieldElement); case ConvertedSyntaxKind.XmlPortTextElement: return(ALSymbolKind.XmlPortTextElement); case ConvertedSyntaxKind.XmlPortFieldAttribute: return(ALSymbolKind.XmlPortFieldAttribute); case ConvertedSyntaxKind.XmlPortTextAttribute: return(ALSymbolKind.XmlPortTextAttribute); case ConvertedSyntaxKind.RequestPage: return(ALSymbolKind.RequestPage); //reports case ConvertedSyntaxKind.ReportDataSetSection: return(ALSymbolKind.ReportDataSetSection); case ConvertedSyntaxKind.ReportLabelsSection: return(ALSymbolKind.ReportLabelsSection); case ConvertedSyntaxKind.ReportDataItem: return(ALSymbolKind.ReportDataItem); case ConvertedSyntaxKind.ReportColumn: return(ALSymbolKind.ReportColumn); case ConvertedSyntaxKind.ReportLabel: return(ALSymbolKind.ReportLabel); case ConvertedSyntaxKind.ReportLabelMultilanguage: return(ALSymbolKind.ReportLabelMultilanguage); //dotnet packages //control add-ins case ConvertedSyntaxKind.EventTriggerDeclaration: return(ALSymbolKind.EventTriggerDeclaration); case ConvertedSyntaxKind.EventDeclaration: return(ALSymbolKind.EventDeclaration); //queries case ConvertedSyntaxKind.QueryElements: return(ALSymbolKind.QueryElements); case ConvertedSyntaxKind.QueryDataItem: return(ALSymbolKind.QueryDataItem); case ConvertedSyntaxKind.QueryColumn: return(ALSymbolKind.QueryColumn); case ConvertedSyntaxKind.QueryFilter: return(ALSymbolKind.QueryFilter); //codeunits //enums and enum extensions case ConvertedSyntaxKind.EnumType: return(ALSymbolKind.EnumType); case ConvertedSyntaxKind.EnumValue: return(ALSymbolKind.EnumValue); case ConvertedSyntaxKind.EnumExtensionType: return(ALSymbolKind.EnumExtensionType); } return(ALSymbolKind.Undefined); }
protected void ProcessNode(dynamic syntaxTree, ALSymbolInformation symbol, dynamic node) { ConvertedSyntaxKind kind = ALEnumConverters.SyntaxKindConverter.Convert(node.Kind); switch (kind) { case ConvertedSyntaxKind.XmlPortTableElement: ProcessXmlPortTableElementNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.ReportDataItem: ProcessReportDataItemNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.ReportColumn: ProcessReportColumnNode(symbol, node); break; case ConvertedSyntaxKind.Key: ProcessKeyNode(symbol, node); break; case ConvertedSyntaxKind.EventDeclaration: ProcessEventDeclarationNode(symbol, node); break; case ConvertedSyntaxKind.TriggerDeclaration: case ConvertedSyntaxKind.EventTriggerDeclaration: case ConvertedSyntaxKind.MethodDeclaration: ProcessMethodOrTriggerDeclarationNode(symbol, node); break; case ConvertedSyntaxKind.Field: ProcessFieldNode(symbol, node); break; case ConvertedSyntaxKind.VariableDeclaration: ProcessVariableDeclarationNode(symbol, node); break; case ConvertedSyntaxKind.Parameter: ProcessParameterNode(symbol, node); break; case ConvertedSyntaxKind.EnumValue: ProcessEnumValueNode(symbol, node); break; case ConvertedSyntaxKind.PageGroup: ProcessPageGroupNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.PageArea: ProcessPageAreaNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.PagePart: ProcessPagePartNode(symbol, node); break; case ConvertedSyntaxKind.PageSystemPart: ProcessPageSystemPartNode(symbol, node); break; case ConvertedSyntaxKind.PageChartPart: ProcessPageChartPartNode(symbol, node); break; case ConvertedSyntaxKind.PageField: ProcessPageFieldNode(symbol, node); break; case ConvertedSyntaxKind.PageExtensionObject: ProcessPageExtensionObjectNode(symbol, node); break; case ConvertedSyntaxKind.ControlAddChange: ProcessControlAddChangeNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.PageCustomizationObject: ProcessPageCustomizationObjectNode(symbol, node); break; case ConvertedSyntaxKind.QueryDataItem: ProcessQueryDataItemNode(syntaxTree, symbol, node); break; case ConvertedSyntaxKind.QueryColumn: ProcessQueryColumnNode(symbol, node); break; } }