ast

package
v0.0.0-...-4349ab3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewIdent     = astcore.NewIdent
	NewIdentRef  = astcore.NewIdentRef
	NewIdentFrom = astcore.NewIdentFrom
	NewIdentList = astcore.NewIdentList
	NewLocation  = astcore.NewLocation
)
View Source
var (
	EmbeddedReal48   = newEmbeddedTypeDecl(EtkReal, "Real48")
	EmbeddedReal     = newEmbeddedTypeDecl(EtkReal, "Real")
	EmbeddedSingile  = newEmbeddedTypeDecl(EtkReal, "Single")
	EmbeddedDouble   = newEmbeddedTypeDecl(EtkReal, "Double")
	EmbeddedExtended = newEmbeddedTypeDecl(EtkReal, "Extended")
	EmbeddedCurrency = newEmbeddedTypeDecl(EtkReal, "Currency")
	EmbeddedComp     = newEmbeddedTypeDecl(EtkReal, "Comp")

	EmbeddedInteger  = newEmbeddedTypeDecl(EtkOrdIdent, "Integer")
	EmbeddedCardinal = newEmbeddedTypeDecl(EtkOrdIdent, "Cardinal")
	EmbeddedShortInt = newEmbeddedTypeDecl(EtkOrdIdent, "ShortInt")
	EmbeddedSmallInt = newEmbeddedTypeDecl(EtkOrdIdent, "SmallInt")
	EmbeddedLongInt  = newEmbeddedTypeDecl(EtkOrdIdent, "LongInt")
	EmbeddedInt64    = newEmbeddedTypeDecl(EtkOrdIdent, "Int64")
	EmbeddedByte     = newEmbeddedTypeDecl(EtkOrdIdent, "Byte")
	EmbeddedWord     = newEmbeddedTypeDecl(EtkOrdIdent, "Word")
	EmbeddedLongWord = newEmbeddedTypeDecl(EtkOrdIdent, "LongWord")
	EmbeddedChar     = newEmbeddedTypeDecl(EtkOrdIdent, "Char")
	EmbeddedAnsiChar = newEmbeddedTypeDecl(EtkOrdIdent, "AnsiChar")
	EmbeddedWideChar = newEmbeddedTypeDecl(EtkOrdIdent, "WideChar")
	EmbeddedBoolean  = newEmbeddedTypeDecl(EtkOrdIdent, "Boolean")

	EmbeddedString     = newEmbeddedTypeDecl(EtkStringType, "String")
	EmbeddedAnsiString = newEmbeddedTypeDecl(EtkStringType, "AnsiString")
	EmbeddedWideString = newEmbeddedTypeDecl(EtkStringType, "WideString")

	EmbeddedPointer   = newEmbeddedTypeDecl(EtkPointerType, "Pointer")
	EmbeddedPChar     = newEmbeddedTypeDecl(EtkPointerType, "PChar")
	EmbeddedPAnsiChar = newEmbeddedTypeDecl(EtkPointerType, "PAnsiChar")
	EmbeddedPWideChar = newEmbeddedTypeDecl(EtkPointerType, "PWideChar")

	EmbeddedVariant    = newEmbeddedTypeDecl(EtkVariantType, "Variant")
	EmbeddedOleVariant = newEmbeddedTypeDecl(EtkVariantType, "OleVariant")
)
View Source
var EmbeddedTypeDeclMap = &embeddedTypeDeclMapSingleton{}

Functions

func EmbeddedTypeDecl

func EmbeddedTypeDecl(kind EmbeddedTypeKind, name string) *astcore.Decl

func IsManifestConstant

func IsManifestConstant(w string) bool

Types

type AddOpTerm

type AddOpTerm struct {
	AddOp string // '+' | '-' | "OR" | "XOR"
	*Term
}
  • AddOp ``` '+' ``` `“ '-' ``` ``` OR ``` ``` XOR ```

func (*AddOpTerm) Children

func (m *AddOpTerm) Children() Nodes

type AddOpTerms

type AddOpTerms []*AddOpTerm

func (AddOpTerms) Children

func (s AddOpTerms) Children() Nodes

type Address

type Address struct {
	*Designator
}

func (*Address) Children

func (m *Address) Children() Nodes

type ArrayType

type ArrayType struct {
	IndexTypes []OrdinalType
	BaseType   Type
	Packed     bool
}

func (*ArrayType) Children

func (m *ArrayType) Children() Nodes

func (*ArrayType) IsPacked

func (m *ArrayType) IsPacked() bool

type AssemblerStatement

type AssemblerStatement struct {
}
  • AssemblerStatement ``` ASM <assemblylanguage> END ```

func (*AssemblerStatement) Children

func (*AssemblerStatement) Children() Nodes

type AssignStatement

type AssignStatement struct {
	Designator *Designator
	Expression *Expression
}

(AssignStatement) ``` Designator ':=' Expression ```

func (*AssignStatement) Children

func (m *AssignStatement) Children() Nodes

type Block

type Block struct {
	DeclSections  DeclSections
	ExportsStmts1 ExportsStmts
	Body          BlockBody
	ExportsStmts2 ExportsStmts
}

func (*Block) Children

func (m *Block) Children() Nodes

type BlockBody

type BlockBody interface {
	StructStmt // extends StructsStmt
	// contains filtered or unexported methods
}

BlockBody is CompoundStmt or AssemblerStatement

type CallStatement

type CallStatement struct {
	Designator *Designator
	ExprList   ExprList // nil able
}

(CallStatement) ``` Designator ['(' ExprList ')'] ```

func (*CallStatement) Children

func (m *CallStatement) Children() Nodes

type CaseLabel

type CaseLabel struct {
	ConstExpr      *ConstExpr
	ExtraConstExpr *ConstExpr
}

func NewCaseLabel

func NewCaseLabel(expr *ConstExpr, extras ...*ConstExpr) *CaseLabel

func (*CaseLabel) Children

func (m *CaseLabel) Children() Nodes

type CaseLabels

type CaseLabels []*CaseLabel

func (CaseLabels) Children

func (s CaseLabels) Children() Nodes

type CaseSelector

type CaseSelector struct {
	Labels    CaseLabels
	Statement *Statement
}
  • CaseSelector ``` CaseLabel ','... ':' Statement ```

func (*CaseSelector) Children

func (m *CaseSelector) Children() Nodes

type CaseSelectors

type CaseSelectors []*CaseSelector

func (CaseSelectors) Children

func (s CaseSelectors) Children() Nodes

type CaseStmt

type CaseStmt struct {
	Expression *Expression
	Selectors  CaseSelectors
	Else       StmtList
}

func (*CaseStmt) Children

func (m *CaseStmt) Children() Nodes

type ClassField

type ClassField struct {
	IdentList IdentList
	Type      Type
}
  • ClassField ``` IdentList ':' Type ```

func (*ClassField) Children

func (m *ClassField) Children() Nodes

func (*ClassField) ToDeclarations

func (m *ClassField) ToDeclarations() astcore.Decls

type ClassFieldList

type ClassFieldList []*ClassField
  • ClassFieldList ``` (ClassField) ';'... ```

func (ClassFieldList) Children

func (s ClassFieldList) Children() Nodes

type ClassHeritage

type ClassHeritage []*TypeId
  • ClassHeritage ``` '(' TypeId ',' ... ')' ```

func (ClassHeritage) Children

func (s ClassHeritage) Children() Nodes

type ClassMemberSection

type ClassMemberSection struct {
	Visibility        ClassVisibility
	ClassFieldList    ClassFieldList
	ClassMethodList   ClassMethodList
	ClassPropertyList ClassPropertyList
}

func (*ClassMemberSection) Children

func (m *ClassMemberSection) Children() Nodes

type ClassMemberSections

type ClassMemberSections []*ClassMemberSection
  • ClassMemberSections ``` ClassMemberSection ... ```

func (ClassMemberSections) Children

func (s ClassMemberSections) Children() Nodes

type ClassMethod

type ClassMethod struct {
	ClassMethod bool
	Heading     ClassMethodHeading
	Directives  ClassMethodDirectiveList
}
  • ClassMethod ``` [CLASS] ClassMethodHeading [';' ClassMethodDirective ...] ```

func (*ClassMethod) Children

func (m *ClassMethod) Children() Nodes

func (*ClassMethod) ToDeclarations

func (m *ClassMethod) ToDeclarations() astcore.Decls

type ClassMethodDirective

type ClassMethodDirective string
  • ClassMethodDirective ``` ABSTRACT ``` ``` VIRTUAL ``` ``` OVERRIDE ``` ``` OVERLOAD ``` ``` REINTRODUCE ```
const (
	CmdAbstract    ClassMethodDirective = "ABSTRACT"
	CmdVirtual     ClassMethodDirective = "VIRTUAL"
	CmdOverride    ClassMethodDirective = "OVERRIDE"
	CmdOverload    ClassMethodDirective = "OVERLOAD"
	CmdReintroduce ClassMethodDirective = "REINTRODUCE"
)

type ClassMethodDirectiveList

type ClassMethodDirectiveList []ClassMethodDirective

func (ClassMethodDirectiveList) Include

func (s ClassMethodDirectiveList) Include(w string) bool

type ClassMethodHeading

type ClassMethodHeading interface {
	Node
	GetIdent() *Ident
	// contains filtered or unexported methods
}
  • ClassMethodHeading ``` ProcedureHeading ``` ``` FunctionHeading ``` ``` ConstructorHeading ``` ``` DestructorHeading ```

type ClassMethodList

type ClassMethodList []*ClassMethod
  • ClassMethodList ``` ClassMethod ';'... ```

func (ClassMethodList) Children

func (s ClassMethodList) Children() Nodes

type ClassProperty

type ClassProperty struct {
	Ident                *Ident
	Interface            *PropertyInterface
	Index                *ConstExpr
	Read                 *IdentRef
	Write                *IdentRef
	Stored               *PropertyStoredSpecifier
	Default              *PropertyDefaultSpecifier
	Implements           *TypeId
	PortabilityDirective PortabilityDirective
	// See "Property overrides and redeclarations" in Object Pascal Language Guide
	Parent *ClassProperty
}
  • ClassProperty ``` PROPERTY Ident PropertyInterface [INDEX ConstExpr] [READ Ident] [WRITE Ident] [STORED (Ident | Constant)] [(DEFAULT ConstExpr) | NODEFAULT] [IMPLEMENTS TypeId] PortabilityDirective ```

func (*ClassProperty) Children

func (m *ClassProperty) Children() Nodes

func (*ClassProperty) ComputedProperty

func (m *ClassProperty) ComputedProperty() *ClassProperty

func (*ClassProperty) InheritsFrom

func (m *ClassProperty) InheritsFrom(parent *ClassProperty) bool

func (*ClassProperty) ToDeclarations

func (m *ClassProperty) ToDeclarations() astcore.Decls

type ClassPropertyList

type ClassPropertyList []*ClassProperty
  • ClassPropertyList ``` ClassProperty ';' ... ```

func (ClassPropertyList) Children

func (s ClassPropertyList) Children() Nodes

type ClassRefType

type ClassRefType interface {
	Type
	IsClassRefType() bool
}

type ClassType

type ClassType interface {
	Type
	IsClassType() bool
}

type ClassVisibility

type ClassVisibility string
  • ClassVisibility ``` [PUBLIC | PROTECTED | PRIVATE | PUBLISHED] ```
const (
	CvDefault   ClassVisibility = "default" // implicitly public
	CvPrivate   ClassVisibility = "PRIVATE"
	CvProtected ClassVisibility = "PROTECTED"
	CvPublic    ClassVisibility = "PUBLIC"
	CvPublished ClassVisibility = "PUBLISHED"
)

type CompoundStmt

type CompoundStmt struct {
	StmtList StmtList
}
  • CompoundStmt ``` BEGIN StmtList END ```

func (*CompoundStmt) Children

func (m *CompoundStmt) Children() Nodes

type ConditionalStmt

type ConditionalStmt interface {
	StructStmt
	// contains filtered or unexported methods
}
  • ConditionalStmt ``` IfStmt ``` ``` CaseStmt ```

type ConstExpr

type ConstExpr = Expression
  • ConstExpr ``` <constant-expression> ```

func NewConstExpr

func NewConstExpr(arg interface{}) *ConstExpr

type ConstExprs

type ConstExprs = ExprList

type ConstSection

type ConstSection []*ConstantDecl // must implement InterfaceDecl
  • ConstSection ``` CONST (ConstantDecl ';')... ```

func (ConstSection) Children

func (s ConstSection) Children() Nodes

func (ConstSection) GetDeclNodes

func (s ConstSection) GetDeclNodes() astcore.DeclNodes

type ConstantDecl

type ConstantDecl struct {
	*Ident
	Type                 Type
	ConstExpr            *ConstExpr
	PortabilityDirective *PortabilityDirective
}

func (*ConstantDecl) Children

func (m *ConstantDecl) Children() Nodes

func (*ConstantDecl) ToDeclarations

func (m *ConstantDecl) ToDeclarations() astcore.Decls

type ConstructorHeading

type ConstructorHeading struct {
	*Ident
	FormalParameters FormalParameters
}

func (*ConstructorHeading) Children

func (m *ConstructorHeading) Children() Nodes

func (*ConstructorHeading) GetIdent

func (m *ConstructorHeading) GetIdent() *Ident

type CustomClassRefType

type CustomClassRefType struct {
	TypeId *TypeId
}

func NewCustomClassRefType

func NewCustomClassRefType(typeId *TypeId) *CustomClassRefType

func (*CustomClassRefType) Children

func (m *CustomClassRefType) Children() Nodes

func (*CustomClassRefType) IsClassRefType

func (*CustomClassRefType) IsClassRefType() bool

type CustomClassType

type CustomClassType struct {
	Heritage ClassHeritage
	Members  ClassMemberSections
}

func (*CustomClassType) Children

func (m *CustomClassType) Children() Nodes

func (*CustomClassType) FindMemberDecl

func (m *CustomClassType) FindMemberDecl(name string, includePrivate bool) *astcore.Decl

func (*CustomClassType) FindProperty

func (m *CustomClassType) FindProperty(name string, acendant bool) *ClassProperty

func (*CustomClassType) GetParentClass

func (m *CustomClassType) GetParentClass() *CustomClassType

func (*CustomClassType) IsClassType

func (*CustomClassType) IsClassType() bool

type CustomInterfaceType

type CustomInterfaceType struct {
	Heritage InterfaceHeritage
	Guid     *InterfaceGuid
	Members  InterfaceMemberList
}

func (*CustomInterfaceType) Children

func (m *CustomInterfaceType) Children() Nodes

func (*CustomInterfaceType) IsInterfaceType

func (*CustomInterfaceType) IsInterfaceType() bool

type CustomObjectType

type CustomObjectType struct {
	Heritage ClassHeritage
	Members  ClassMemberSections
}

func (*CustomObjectType) Children

func (m *CustomObjectType) Children() Nodes

func (*CustomObjectType) IsObjectType

func (*CustomObjectType) IsObjectType() bool

type CustomPointerType

type CustomPointerType struct {
	TypeId *TypeId
}

func NewCustomPointerType

func NewCustomPointerType(typeId *TypeId) *CustomPointerType

func (*CustomPointerType) Children

func (m *CustomPointerType) Children() Nodes

func (*CustomPointerType) IsPointerType

func (*CustomPointerType) IsPointerType() bool

type DeclSection

type DeclSection interface {
	Node
	// contains filtered or unexported methods
}
  • DeclSection ``` LabelDeclSection ``` ``` ConstSection ``` ``` TypeSection ``` ``` VarSection ``` ``` ProcedureDeclSection ```

type DeclSections

type DeclSections []DeclSection // must implement Node

func (DeclSections) Children

func (m DeclSections) Children() Nodes

type Designator

type Designator struct {
	*QualId
	Items DesignatorItems
}
  • Designator ``` QualId ['.' Ident | '[' ExprList ']' | '^']... ```

func NewDesignator

func NewDesignator(arg interface{}) *Designator

func (*Designator) Children

func (m *Designator) Children() Nodes

type DesignatorFactor

type DesignatorFactor struct {
	*Designator
	ExprList ExprList
}

func NewDesignatorFactor

func NewDesignatorFactor(arg interface{}) *DesignatorFactor

func (*DesignatorFactor) Children

func (m *DesignatorFactor) Children() Nodes

type DesignatorItem

type DesignatorItem interface {
	Node
	// contains filtered or unexported methods
}

type DesignatorItemDereference

type DesignatorItemDereference struct {
}

func (*DesignatorItemDereference) Children

func (*DesignatorItemDereference) Children() Nodes

type DesignatorItemExprList

type DesignatorItemExprList ExprList // Must implement DesignatorItem, and ancestor ExprList implements Node.

func (DesignatorItemExprList) Children

func (s DesignatorItemExprList) Children() Nodes

type DesignatorItemIdent

type DesignatorItemIdent struct {
	*Ident
}

func NewDesignatorItemIdent

func NewDesignatorItemIdent(arg interface{}) *DesignatorItemIdent

func (*DesignatorItemIdent) Children

func (m *DesignatorItemIdent) Children() Nodes

type DesignatorItems

type DesignatorItems []DesignatorItem

func (DesignatorItems) Children

func (s DesignatorItems) Children() Nodes

type DesignatorStatement

type DesignatorStatement interface {
	SimpleStatement
	// contains filtered or unexported methods
}

DesignatorStatement is an interface for CallStatement and AssignStatement

type DestructorHeading

type DestructorHeading struct {
	*Ident
}
  • DestructorHeading ``` DESTRUCTOR Ident ```

func (*DestructorHeading) Children

func (m *DestructorHeading) Children() Nodes

func (*DestructorHeading) GetIdent

func (m *DestructorHeading) GetIdent() *Ident

type Directive

type Directive string
const (
	DrCdecl       Directive = "CDECL"
	DrRegister    Directive = "REGISTER"
	DrDynamic     Directive = "DYNAMIC"
	DrVirtual     Directive = "VIRTUAL"
	DrExport      Directive = "EXPORT"
	DrExternal    Directive = "EXTERNAL"
	DrNear        Directive = "NEAR"
	DrFar         Directive = "FAR"
	DrForward     Directive = "FORWARD"
	DrMessage     Directive = "MESSAGE" // MESSAGE ConstExpr
	DrOverride    Directive = "OVERRIDE"
	DrOverload    Directive = "OVERLOAD"
	DrPascal      Directive = "PASCAL"
	DrReintroduce Directive = "REINTRODUCE"
	DrSafecall    Directive = "SAFECALL"
	DrStdcall     Directive = "STDCALL"
	DrVarArgs     Directive = "VARARGS"
	DrLocal       Directive = "LOCAL"
	DrAbstract    Directive = "ABSTRACT"
)

type EmbeddedTypeKind

type EmbeddedTypeKind int
const (
	EtkReal EmbeddedTypeKind = iota + 1
	EtkOrdIdent
	EtkStringType
	EtkPointerType
	EtkVariantType
)

type EnumeratedType

type EnumeratedType []*EnumeratedTypeElement // must implement OrdinalType
  • EnumeratedType ``` '(' EnumeratedTypeElement ','... ')' ```
  • EnumeratedTypeElement ``` Ident [ '=' ConstExpr ] ```

func (EnumeratedType) Children

func (m EnumeratedType) Children() Nodes

func (EnumeratedType) IsOrdinalType

func (EnumeratedType) IsOrdinalType() bool

func (EnumeratedType) IsSimpleType

func (EnumeratedType) IsSimpleType() bool

type EnumeratedTypeElement

type EnumeratedTypeElement struct {
	astcore.DeclNode
	*Ident
	ConstExpr *ConstExpr
}

func (*EnumeratedTypeElement) Children

func (m *EnumeratedTypeElement) Children() Nodes

func (*EnumeratedTypeElement) ToDeclarations

func (m *EnumeratedTypeElement) ToDeclarations() astcore.Decls

type ExceptionBlock

type ExceptionBlock struct {
	Handlers ExceptionBlockHandlers
	Else     StmtList
}
  • ExceptionBlock ``` [ON [Ident ‘:’] TypeID DO Statement]... [ELSE Statement...] ```

func (*ExceptionBlock) Children

func (m *ExceptionBlock) Children() Nodes

type ExceptionBlockHandler

type ExceptionBlockHandler struct {
	Decl      *ExceptionBlockHandlerDecl
	Statement *Statement
}

func (*ExceptionBlockHandler) Children

func (m *ExceptionBlockHandler) Children() Nodes

type ExceptionBlockHandlerDecl

type ExceptionBlockHandlerDecl struct {
	Ident *Ident
	Type  Type
}

func (*ExceptionBlockHandlerDecl) Children

func (m *ExceptionBlockHandlerDecl) Children() Nodes

func (*ExceptionBlockHandlerDecl) ToDeclarations

func (m *ExceptionBlockHandlerDecl) ToDeclarations() astcore.Decls

type ExceptionBlockHandlers

type ExceptionBlockHandlers []*ExceptionBlockHandler

func (ExceptionBlockHandlers) Children

func (s ExceptionBlockHandlers) Children() Nodes

type ExportedHeading

type ExportedHeading struct {
	*FunctionHeading
	Directives      []Directive
	ExternalOptions *ExternalOptions
}
  • ExportedHeading ``` ProcedureHeading ';' Directive ``` ``` FunctionHeading ';' Directive ```

func (*ExportedHeading) Children

func (m *ExportedHeading) Children() Nodes

func (*ExportedHeading) GetDeclNodes

func (m *ExportedHeading) GetDeclNodes() astcore.DeclNodes

func (*ExportedHeading) ToDeclarations

func (m *ExportedHeading) ToDeclarations() astcore.Decls

type ExportsItem

type ExportsItem struct {
	*Ident
	Name  *ConstExpr
	Index *ConstExpr
}
  • ExportsItem ``` Ident [NAME|INDEX “‘” ConstExpr “‘”] [INDEX|NAME “‘” ConstExpr “‘”] ```

func (*ExportsItem) Children

func (m *ExportsItem) Children() Nodes

type ExportsStmt

type ExportsStmt struct {
	ExportsItems []*ExportsItem
}
  • ExportsStmt ``` EXPORTS ExportsItem [, ExportsItem]... ```

func (*ExportsStmt) Children

func (m *ExportsStmt) Children() Nodes

type ExportsStmts

type ExportsStmts []*ExportsStmt

func (ExportsStmts) Children

func (s ExportsStmts) Children() Nodes

type ExprList

type ExprList []*Expression
  • ExprList ``` Expression ','... ```

func (ExprList) Children

func (s ExprList) Children() Nodes

type Expression

type Expression struct {
	*SimpleExpression
	RelOpSimpleExpressions RelOpSimpleExpressions
}
  • Expression ``` SimpleExpression [RelOp SimpleExpression]... ```

func NewExpression

func NewExpression(arg interface{}) *Expression

func (*Expression) Children

func (m *Expression) Children() Nodes

type ExternalOptions

type ExternalOptions struct {
	LibraryName string
	Name        *string
	Index       *int
}

Directive external can be used like these

external;
external stringConstant;
external stringConstant1 name stringConstant2;
external stringConstant index integerConstant;

func NewExternalOptions

func NewExternalOptions(libraryName string, args ...interface{}) *ExternalOptions

type Factor

type Factor interface {
	Node
	// contains filtered or unexported methods
}
  • Factor ``` Designator ['(' ExprList ')'] ``` ``` '@' Designator ``` ``` Number ``` ``` String ``` ``` NIL ``` ``` '(' Expression ')' ``` ``` NOT Factor ``` ``` SetConstructor ``` ``` TypeId '(' Expression ')' ```

type FieldDecl

type FieldDecl struct {
	IdentList IdentList
	Type      Type
}

func (*FieldDecl) Children

func (m *FieldDecl) Children() Nodes

func (*FieldDecl) ToDeclarations

func (m *FieldDecl) ToDeclarations() astcore.Decls

type FieldDecls

type FieldDecls []*FieldDecl

func (FieldDecls) Children

func (s FieldDecls) Children() Nodes

type FieldList

type FieldList struct {
	FieldDecls     FieldDecls
	VariantSection *VariantSection
}

func (*FieldList) Children

func (m *FieldList) Children() Nodes

type FileType

type FileType struct {
	*TypeId
	Packed bool
}

func (*FileType) Children

func (m *FileType) Children() Nodes

func (*FileType) IsPacked

func (m *FileType) IsPacked() bool

type FixedStringType

type FixedStringType struct {
	StringType
	Length *ConstExpr
}

func NewFixedStringType

func NewFixedStringType(ident *Ident, length *ConstExpr) *FixedStringType

func (*FixedStringType) Children

func (m *FixedStringType) Children() Nodes

func (*FixedStringType) IsStringType

func (*FixedStringType) IsStringType() bool

type ForStmt

type ForStmt struct {
	QualId    *QualId
	Initial   *Expression
	Terminal  *Expression
	Down      bool // false: TO, true: DOWNTO
	Statement *Statement
}
  • ForStmt ``` FOR QualId ':=' Expression (TO | DOWNTO) Expression DO Statement ```

func (*ForStmt) Children

func (m *ForStmt) Children() Nodes

type FormalParameters

type FormalParameters []*FormalParm
  • FormalParameters ``` '(' [FormalParm ';'...] ')' ```

func (FormalParameters) Children

func (s FormalParameters) Children() Nodes

type FormalParm

type FormalParm struct {
	Opt *FormalParmOption
	*Parameter
}

func NewFormalParm

func NewFormalParm(name interface{}, args ...interface{}) *FormalParm

func (*FormalParm) Children

func (m *FormalParm) Children() Nodes

func (*FormalParm) ToDeclarations

func (m *FormalParm) ToDeclarations() astcore.Decls

type FormalParmOption

type FormalParmOption string
  • FormalParm ``` [VAR | CONST | OUT] Parameter ```
var (
	FpoVar   FormalParmOption = "VAR"
	FpoConst FormalParmOption = "CONST"
	FpoOut   FormalParmOption = "OUT"
)

type ForwardDeclaration

type ForwardDeclaration interface {
	SetActualType(Type) error
}

type ForwardDeclaredClassType

type ForwardDeclaredClassType struct {
	// This will be set at the end of actual class type declaration.
	Actual *CustomClassType
}
  • ForwardDeclaredClassType ``` CLASS ```

func (*ForwardDeclaredClassType) Children

func (m *ForwardDeclaredClassType) Children() Nodes

func (*ForwardDeclaredClassType) IsClassType

func (*ForwardDeclaredClassType) IsClassType() bool

func (*ForwardDeclaredClassType) SetActualType

func (m *ForwardDeclaredClassType) SetActualType(t Type) error

type FunctionDecl

type FunctionDecl struct {
	*FunctionHeading
	Directives           []Directive
	ExternalOptions      *ExternalOptions
	PortabilityDirective *PortabilityDirective
	Block                *Block
}

func (*FunctionDecl) Children

func (m *FunctionDecl) Children() Nodes

func (*FunctionDecl) ToDeclarations

func (m *FunctionDecl) ToDeclarations() astcore.Decls

type FunctionHeading

type FunctionHeading struct {
	Type FunctionType
	*Ident
	FormalParameters FormalParameters
	ReturnType       *TypeId
}

func (*FunctionHeading) Children

func (s *FunctionHeading) Children() Nodes

func (*FunctionHeading) GetIdent

func (s *FunctionHeading) GetIdent() *Ident

type FunctionType

type FunctionType uint
const (
	FtProcedure FunctionType = iota
	FtFunction
)

type Goal

type Goal interface {
	astcore.DeclNode

	GetPath() string
	// contains filtered or unexported methods
}
  • Goal ``` (Program | Package | Library | Unit) ```

type GotoStatement

type GotoStatement struct {
	LabelId *LabelId
	Ref     *astcore.Decl
}

(GotoStatement) ``` GOTO LabelId ```

func (*GotoStatement) Children

func (m *GotoStatement) Children() Nodes

type Ident

type Ident = astcore.Ident

type IdentList

type IdentList = astcore.IdentList

type IdentRef

type IdentRef = astcore.IdentRef

type IfStmt

type IfStmt struct {
	Condition *Expression
	Then      *Statement
	Else      *Statement
}

func (*IfStmt) Children

func (m *IfStmt) Children() Nodes

type ImplementationSection

type ImplementationSection struct {
	UsesClause   UsesClause // optional
	DeclSections DeclSections
	ExportsStmts ExportsStmts
	Node
}

func (*ImplementationSection) Children

func (m *ImplementationSection) Children() Nodes

type InheritedStatement

type InheritedStatement struct {
	Ref *astcore.Decl // reference to the ancestor method
}

(InheritedStatement) ``` INHERITED ```

func (*InheritedStatement) Children

func (*InheritedStatement) Children() Nodes

type InitSection

type InitSection struct {
	InitializationStmts StmtList
	FinalizationStmts   StmtList
}
  • InitSection ``` INITIALIZATION StmtList [FINALIZATION StmtList] END ``` ``` BEGIN StmtList END ``` ``` END ```

func (*InitSection) Children

func (m *InitSection) Children() Nodes

type InterfaceDecl

type InterfaceDecl interface {
	Node

	GetDeclNodes() astcore.DeclNodes
	// contains filtered or unexported methods
}
  • InterfaceDecl ``` ConstSection ``` ``` TypeSection ``` ``` VarSection ``` ``` ExportedHeading ```

type InterfaceDecls

type InterfaceDecls []InterfaceDecl

func (InterfaceDecls) Children

func (s InterfaceDecls) Children() Nodes

type InterfaceGuid

type InterfaceGuid struct {
	*ConstExpr
}
  • InterfaceGuid ``` '[' ConstExpr of string ']' ```

func (*InterfaceGuid) Children

func (m *InterfaceGuid) Children() Nodes

type InterfaceHeritage

type InterfaceHeritage []*TypeId
  • InterfaceHeritage ```

'(' TypeId ',' ... ')'

```

func (InterfaceHeritage) Children

func (s InterfaceHeritage) Children() Nodes

type InterfaceMember

type InterfaceMember interface {
	Node
	// contains filtered or unexported methods
}
  • InterfaceMember ``` InterfaceMethod ``` ``` InterfaceProperty ```

type InterfaceMemberList

type InterfaceMemberList []InterfaceMember
  • InterfaceMemberList ``` InterfaceMember ';'... ```

func (InterfaceMemberList) Children

func (s InterfaceMemberList) Children() Nodes

type InterfaceMethod

type InterfaceMethod struct {
	Heading    InterfaceMethodHeading
	Directives InterfaceMethodDirectives
}
  • InterfaceMethod ``` InterfaceMethodHeading; [InterfaceMethodDirective ';'...]; ```

func (*InterfaceMethod) Children

func (m *InterfaceMethod) Children() Nodes

type InterfaceMethodDirective

type InterfaceMethodDirective string
  • InterfaceMethodDirective ``` stdcall ```
const (
	ImdStdcall InterfaceMethodDirective = "STDCALL"
)

type InterfaceMethodDirectives

type InterfaceMethodDirectives []InterfaceMethodDirective

type InterfaceMethodHeading

type InterfaceMethodHeading interface {
	Node
	// contains filtered or unexported methods
}
  • InterfaceMethodHeading ``` ProcedureHeading ``` ``` FunctionHeading ```

type InterfaceProperty

type InterfaceProperty struct {
	Ident     *Ident
	Interface *PropertyInterface
	Read      *IdentRef
	Write     *IdentRef
}
  • InterfaceProperty ``` PROPERTY Ident PropertyInterface [READ Ident] [WRITE Ident] ```

func (*InterfaceProperty) Children

func (m *InterfaceProperty) Children() Nodes

type InterfaceSection

type InterfaceSection struct {
	UsesClause     UsesClause // optional
	InterfaceDecls InterfaceDecls
}

func (*InterfaceSection) Children

func (m *InterfaceSection) Children() Nodes

type InterfaceType

type InterfaceType interface {
	IsInterfaceType() bool
	// implements
	Type
}

type LabelDeclSection

type LabelDeclSection struct {
	*LabelId
}
  • LabelDeclSection ``` LABEL LabelId ';' ```

func (*LabelDeclSection) Children

func (m *LabelDeclSection) Children() Nodes

func (*LabelDeclSection) ToDeclarations

func (m *LabelDeclSection) ToDeclarations() astcore.Decls

type LabelId

type LabelId = Ident

func NewLabelId

func NewLabelId(ident *Ident) *LabelId

type Location

type Location = astcore.Location

type LoopStmt

type LoopStmt interface {
	StructStmt
	// contains filtered or unexported methods
}
  • LoopStmt ``` RepeatStmt ``` ``` WhileStmt ``` ``` ForStmt ```

type MulOpFactor

type MulOpFactor struct {
	MulOp  string // '*' | '/' | "DIV" | "MOD", "AND", "SHL", "SHR"
	Factor Factor
}
  • MulOp ``` '*' ``` `“ '/' ``` `“ DIV ``` `“ MOD ``` ``` AND ``` ``` SHL ``` ``` SHR ``` ``` AS ```

func (*MulOpFactor) Children

func (m *MulOpFactor) Children() Nodes

type MulOpFactors

type MulOpFactors []*MulOpFactor

func (MulOpFactors) Children

func (s MulOpFactors) Children() Nodes

type Namespace

type Namespace interface {
	GetIdent() *Ident

	// Declarations in the namespace.
	// They are called by just only its ident or by Namespace.(ident)
	// InsideDecls doesn't include unit names in uses clause. because
	// they can't be called by namespace.(unit name)
	GetDeclMap() astcore.DeclMap
}

implemented by Program and Unit.

type Nil

type Nil struct {
}

func NewNil

func NewNil() *Nil

func (*Nil) Children

func (*Nil) Children() Nodes

type Node

type Node = astcore.Node

type Nodes

type Nodes = astcore.Nodes

type Not

type Not struct {
	Factor
}

func (*Not) Children

func (m *Not) Children() Nodes

type NumberFactor

type NumberFactor struct {
	Value string
}

func NewNumber

func NewNumber(v string) *NumberFactor

func (*NumberFactor) Children

func (*NumberFactor) Children() Nodes

type ObjectType

type ObjectType interface {
	Type
	IsObjectType() bool
}

type OrdIdent

type OrdIdent interface {
	OrdinalType
	IsOrdIdent() bool
}
  • OrdIdent ``` SHORTINT ``` ``` SMALLINT ``` ``` INTEGER ``` ``` BYTE ``` ``` LONGINT ``` ``` INT64 ``` ``` WORD ``` ``` BOOLEAN ``` ``` CHAR ``` ``` WIDECHAR ``` ``` LONGWORD ``` ``` PCHAR ```

type OrdinalType

type OrdinalType interface {
	SimpleType
	IsOrdinalType() bool
}

type Parameter

type Parameter struct {
	IdentList
	Type      *ParameterType
	ConstExpr *ConstExpr
}

func NewParameter

func NewParameter(name interface{}, typArg interface{}, args ...interface{}) *Parameter

func (*Parameter) Children

func (m *Parameter) Children() Nodes

func (*Parameter) SetConstExpr

func (m *Parameter) SetConstExpr(arg interface{})

type ParameterType

type ParameterType struct {
	Type    Type
	IsArray bool
}
  • Parameter ``` IdentList [':' ([ARRAY OF] SimpleType | STRING | FILE)] ``` (Parameter type is not only SimpleType, STRING or FILE. TypeId also can be also.) ``` Ident ':' SimpleType '=' ConstExpr ```

func NewArrayParameterType

func NewArrayParameterType(arg interface{}) *ParameterType

func NewParameterType

func NewParameterType(arg interface{}) *ParameterType

func (*ParameterType) Children

func (m *ParameterType) Children() Nodes

type Parentheses

type Parentheses struct {
	Expression *Expression
}

Parentheses

func (*Parentheses) Children

func (m *Parentheses) Children() Nodes

type PointerType

type PointerType interface {
	Type
	IsPointerType() bool
}

type PortabilityDirective

type PortabilityDirective string
const (
	PdPlatform   PortabilityDirective = "platform"
	PdDeprecated PortabilityDirective = "deprecated"
	PdLibrary    PortabilityDirective = "library"
)

type Position

type Position = astcore.Position

type ProcedureDeclSection

type ProcedureDeclSection interface {
	DeclSection
	// contains filtered or unexported methods
}
  • ProcedureDeclSection ``` ProcedureDecl ``` ``` FunctionDecl ```

type ProcedureType

type ProcedureType struct {
	FunctionType     FunctionType
	FormalParameters FormalParameters
	ReturnType       *TypeId
	OfObject         bool
}

func (ProcedureType) Children

func (m ProcedureType) Children() Nodes

type Program

type Program struct {
	Path string
	*Ident

	ProgramBlock *ProgramBlock
	DeclMap      astcore.DeclMap
}
  • Program ``` [PROGRAM Ident ['(' IdentList ')'] ';'] ProgramBlock '.' ```

In standard Pascal, a program heading can include parameters after the program name:

program Calc(input, output);

Borland’s Object Pascal compiler ignores these parameters.

func (*Program) Children

func (m *Program) Children() Nodes

func (*Program) GetDeclMap

func (m *Program) GetDeclMap() astcore.DeclMap

func (*Program) GetIdent

func (m *Program) GetIdent() *Ident

func (*Program) GetPath

func (m *Program) GetPath() string

func (*Program) ToDeclarations

func (m *Program) ToDeclarations() astcore.Decls

type ProgramBlock

type ProgramBlock struct {
	UsesClause UsesClause
	*Block
}

func (*ProgramBlock) Children

func (m *ProgramBlock) Children() Nodes

type PropertyDefaultSpecifier

type PropertyDefaultSpecifier struct {
	Value     *ConstExpr
	NoDefault *bool
}

func (*PropertyDefaultSpecifier) Children

func (m *PropertyDefaultSpecifier) Children() Nodes

type PropertyInterface

type PropertyInterface struct {
	Parameters FormalParameters
	Type       *TypeId
}

func (*PropertyInterface) Children

func (m *PropertyInterface) Children() Nodes

type PropertyStoredSpecifier

type PropertyStoredSpecifier struct {
	IdentRef *IdentRef
	Constant *bool
}

func (*PropertyStoredSpecifier) Children

func (m *PropertyStoredSpecifier) Children() Nodes

type QualId

type QualId struct {
	NamespaceId *IdentRef
	Ident       *IdentRef
}
  • QualId ``` [NamespaceId '.'] Ident ```
  • NamespaceId ``` <unit-identifier> ``` ``` <program-identifier> ```

func NewQualId

func NewQualId(unitId *IdentRef, ident *IdentRef) *QualId

func (*QualId) Children

func (m *QualId) Children() Nodes

type QualIds

type QualIds []*QualId

QualIds

func (QualIds) Children

func (s QualIds) Children() Nodes

type RaiseStmt

type RaiseStmt struct {
	Object  *Expression
	Address *Expression
}
  • RaiseStmt ``` RAISE [object] [AT address] ```

func (*RaiseStmt) Children

func (m *RaiseStmt) Children() Nodes

type RealType

type RealType interface {
	SimpleType
	IsRealType() bool
}
  • RealType ``` REAL48 ``` ``` REAL ``` ``` SINGLE ``` ``` DOUBLE ``` ``` EXTENDED ``` ``` CURRENCY ``` ``` COMP ```

type RecType

type RecType struct {
	FieldList *FieldList
	Packed    bool
}

func (*RecType) Children

func (m *RecType) Children() Nodes

func (*RecType) IsPacked

func (m *RecType) IsPacked() bool

type RecVariant

type RecVariant struct {
	ConstExprs ConstExprs
	FieldList  *FieldList
}
  • RecVariant ``` ConstExpr ','... ':' '(' FieldList ')' ```

func (*RecVariant) Children

func (m *RecVariant) Children() Nodes

type RecVariants

type RecVariants []*RecVariant

func (RecVariants) Children

func (s RecVariants) Children() Nodes

type RelOpSimpleExpression

type RelOpSimpleExpression struct {
	RelOp string // '>' | '<' | '<=' | '>=' | '=' | '<>' | "IN" | "IS" | "AS"
	*SimpleExpression
}
  • RelOp ``` '>' ``` `“ '<' ``` ``` '<=' ``` ``` '>=' ``` ``` '=' ``` ``` '<>' ``` ``` IN ``` ``` IS ```

func (*RelOpSimpleExpression) Children

func (m *RelOpSimpleExpression) Children() Nodes

type RelOpSimpleExpressions

type RelOpSimpleExpressions []*RelOpSimpleExpression

func (RelOpSimpleExpressions) Children

func (s RelOpSimpleExpressions) Children() Nodes

type RepeatStmt

type RepeatStmt struct {
	StmtList  StmtList
	Condition *Expression
}
  • RepeatStmt ``` REPEAT StmtList UNTIL Expression ```

func (*RepeatStmt) Children

func (m *RepeatStmt) Children() Nodes

type SetConstructor

type SetConstructor struct {
	SetElements []*SetElement
}
  • SetConstructor ``` '[' [SetElement ','...] ']' ```

func (*SetConstructor) Children

func (m *SetConstructor) Children() Nodes

type SetElement

type SetElement struct {
	*Expression
	SubRangeEnd *Expression
}
  • SetElement ``` Expression ['..' Expression] ```

func NewSetElement

func NewSetElement(expr *Expression) *SetElement

func (*SetElement) Children

func (m *SetElement) Children() Nodes

type SetType

type SetType struct {
	OrdinalType
	Packed bool
}

func (*SetType) Children

func (m *SetType) Children() Nodes

func (*SetType) IsPacked

func (m *SetType) IsPacked() bool

type SimpleExpression

type SimpleExpression struct {
	UnaryOp *string //  '+' | '-' or nil
	*Term
	AddOpTerms AddOpTerms
}
  • SimpleExpression ``` ['+' | '-'] Term [AddOp Term]... ```

func NewSimpleExpression

func NewSimpleExpression(arg interface{}) *SimpleExpression

func (*SimpleExpression) Children

func (m *SimpleExpression) Children() Nodes

type SimpleStatement

type SimpleStatement interface {
	StatementBody
	// contains filtered or unexported methods
}

type SimpleType

type SimpleType interface {
	Type
	IsSimpleType() bool
}
  • SimpleType ``` (OrdinalType | RealType) ```

type Statement

type Statement struct {
	LabelId *LabelId
	Body    StatementBody
}
  • Statement ``` [LabelId ':'] [SimpleStatement | StructStmt] ```

func (*Statement) Children

func (m *Statement) Children() Nodes

type StatementBody

type StatementBody interface {
	Node
	// contains filtered or unexported methods
}
  • SimpleStatement (CallStatement) ``` Designator ['(' ExprList ')'] ``` (AssignStatement) ``` Designator ':=' Expression ``` (InheritedStatement) ``` INHERITED ``` (GotoStatement) ``` GOTO LabelId ```
  • StructStmt ``` CompoundStmt ``` ``` ConditionalStmt ``` ``` LoopStmt ``` ``` WithStmt ``` ``` TryExceptStmt ``` ``` TryFinallyStmt ``` ``` RaiseStmt ``` ``` AssemblerStmt ```

type StmtList

type StmtList []*Statement
  • StmtList ``` (Statement ';') ... ```

func (StmtList) Children

func (s StmtList) Children() Nodes

type StringFactor

type StringFactor struct {
	Value string
}

``` String ```

func NewString

func NewString(v string) *StringFactor

func (*StringFactor) Children

func (*StringFactor) Children() Nodes

type StringType

type StringType interface {
	Type
	IsStringType() bool
}
  • StringType ``` STRING ``` ``` ANSISTRING ``` ``` WIDESTRING ``` ``` STRING '[' ConstExpr ']' ```

type StrucType

type StrucType interface {
	Type

	IsPacked() bool
	// contains filtered or unexported methods
}
  • StrucType ``` [PACKED] (ArrayType [PACKED]| SetType | FileType | RecType [PACKED]) ```

NOTICE this is NOT "StructType" but "StrucType"

type StructStmt

type StructStmt interface {
	StatementBody
	// contains filtered or unexported methods
}

type SubrangeType

type SubrangeType struct {
	OrdinalType
	Low  *ConstExpr
	High *ConstExpr
}
  • SubrangeType ``` ConstExpr '..' ConstExpr ```

func (*SubrangeType) Children

func (m *SubrangeType) Children() Nodes

func (*SubrangeType) IsOrdinalType

func (*SubrangeType) IsOrdinalType() bool

func (*SubrangeType) IsSimpleType

func (*SubrangeType) IsSimpleType() bool

type Term

type Term struct {
	Factor       Factor
	MulOpFactors MulOpFactors
}
  • Term ``` Factor [MulOp Factor]... ```

func NewTerm

func NewTerm(arg interface{}) *Term

func (*Term) Children

func (m *Term) Children() Nodes

type ThreadVarDecl

type ThreadVarDecl struct {
	IdentList
	Type Type
}

func (*ThreadVarDecl) Children

func (m *ThreadVarDecl) Children() Nodes

func (*ThreadVarDecl) ToDeclarations

func (m *ThreadVarDecl) ToDeclarations() astcore.Decls

type ThreadVarSection

type ThreadVarSection []*ThreadVarDecl // must implement InterfaceDecl

threadvar X: Integer; Thread-variable declarations • cannot occur within a procedure or function. • cannot include initializations. • cannot specify the absolute directive.

func (ThreadVarSection) Children

func (s ThreadVarSection) Children() Nodes

func (ThreadVarSection) GetDeclNodes

func (s ThreadVarSection) GetDeclNodes() astcore.DeclNodes

type TryExceptStmt

type TryExceptStmt struct {
	Statements     StmtList
	ExceptionBlock *ExceptionBlock
}
  • TryExceptStmt ``` TRY Statement... EXCEPT ExceptionBlock END ```

func (*TryExceptStmt) Children

func (m *TryExceptStmt) Children() Nodes

type TryFinallyStmt

type TryFinallyStmt struct {
	Statements1 StmtList
	Statements2 StmtList
}
  • TryFinallyStmt ``` TRY Statement FINALLY Statement END ```

func (*TryFinallyStmt) Children

func (m *TryFinallyStmt) Children() Nodes

type TryStmt

type TryStmt interface {
	StructStmt
	// contains filtered or unexported methods
}

type Type

type Type interface {
	Node
	// contains filtered or unexported methods
}
  • Type ``` TypeId ``` ``` SimpleType ``` ``` StrucType ``` ``` PointerType ``` ``` StringType ``` ``` ProcedureType ``` ``` VariantType ``` ``` ClassRefType ```

type TypeCast

type TypeCast struct {
	TypeId     *TypeId
	Expression *Expression
}

``` TypeId '(' Expression ')' ```

func (*TypeCast) Children

func (m *TypeCast) Children() Nodes

type TypeDecl

type TypeDecl struct {
	*Ident
	Type                 Type
	PortabilityDirective *PortabilityDirective
}

func (*TypeDecl) Children

func (m *TypeDecl) Children() Nodes

func (*TypeDecl) ToDeclarations

func (m *TypeDecl) ToDeclarations() astcore.Decls

type TypeEmbedded

type TypeEmbedded struct {
	Kind  EmbeddedTypeKind
	Ident *Ident
}

func (*TypeEmbedded) Children

func (m *TypeEmbedded) Children() Nodes

func (*TypeEmbedded) IsOrdIdent

func (m *TypeEmbedded) IsOrdIdent() bool

func (*TypeEmbedded) IsOrdinalType

func (m *TypeEmbedded) IsOrdinalType() bool

func (*TypeEmbedded) IsPointerType

func (m *TypeEmbedded) IsPointerType() bool

func (*TypeEmbedded) IsRealType

func (m *TypeEmbedded) IsRealType() bool

func (*TypeEmbedded) IsSimpleType

func (m *TypeEmbedded) IsSimpleType() bool

func (*TypeEmbedded) IsStringType

func (m *TypeEmbedded) IsStringType() bool

func (*TypeEmbedded) IsVariantType

func (m *TypeEmbedded) IsVariantType() bool

type TypeId

type TypeId struct {
	Type
	UnitId *UnitId
	Ident  *Ident
	Ref    *astcore.Decl // Actual Type object
}
  • TypeId ``` [UnitId '.'] <type-identifier> ```

func NewEmbeddedPointerType

func NewEmbeddedPointerType(v *Ident) *TypeId

func NewOrdIdent

func NewOrdIdent(ident *Ident) *TypeId

func NewPointerType

func NewPointerType(ident *Ident) *TypeId

func NewRealType

func NewRealType(ident *Ident) *TypeId

func NewStringType

func NewStringType(ident *Ident) *TypeId

func NewTypeId

func NewTypeId(unitIdOrIdent interface{}, args ...interface{}) *TypeId

func NewVariantType

func NewVariantType(v *Ident) *TypeId

func (*TypeId) Children

func (m *TypeId) Children() Nodes

func (*TypeId) IsOrdIdent

func (m *TypeId) IsOrdIdent() bool

func (*TypeId) IsOrdinalType

func (m *TypeId) IsOrdinalType() bool

func (*TypeId) IsPointerType

func (m *TypeId) IsPointerType() bool

func (*TypeId) IsRealType

func (m *TypeId) IsRealType() bool

func (*TypeId) IsSimpleType

func (m *TypeId) IsSimpleType() bool

func (*TypeId) IsStringType

func (m *TypeId) IsStringType() bool

func (*TypeId) IsVariantType

func (m *TypeId) IsVariantType() bool

type TypeSection

type TypeSection []*TypeDecl
  • TypeSection ``` TYPE (TypeDecl ';')... ```

func (TypeSection) Children

func (s TypeSection) Children() Nodes

func (TypeSection) GetDeclNodes

func (s TypeSection) GetDeclNodes() astcore.DeclNodes

type Unit

type Unit struct {
	Path string
	*Ident
	PortabilityDirective  *PortabilityDirective // optional
	InterfaceSection      *InterfaceSection
	ImplementationSection *ImplementationSection
	InitSection           *InitSection // optional
	DeclMap               astcore.DeclMap

	Namespace
	Goal
}

func (*Unit) Children

func (m *Unit) Children() Nodes

func (*Unit) GetDeclMap

func (m *Unit) GetDeclMap() astcore.DeclMap

func (*Unit) GetIdent

func (m *Unit) GetIdent() *Ident

func (*Unit) GetPath

func (m *Unit) GetPath() string

func (*Unit) ToDeclarations

func (m *Unit) ToDeclarations() astcore.Decls

type UnitId

type UnitId = Ident
  • UnitId ``` <unit-identifier> ```

func NewUnitId

func NewUnitId(name interface{}) *UnitId

type Units

type Units []*Unit

func (Units) ByName

func (s Units) ByName(name string) *Unit

func (Units) Compact

func (s Units) Compact() Units

func (Units) DeclMaps

func (s Units) DeclMaps() astcore.DeclMaps

type UsesClause

type UsesClause []*UsesClauseItem
  • UsesClause ``` USES IdentList ';' ```

In the uses clause of a program or library, any unit name may be followed by the reserved word in and the name of a source file, with or without a directory path, in single quotation marks; directory paths can be absolute or relative. Examples:

uses Windows, Messages, SysUtils, Strings in 'C:\Classes\Strings.pas', Classes;

func (UsesClause) Children

func (s UsesClause) Children() Nodes

func (UsesClause) Find

func (s UsesClause) Find(name string) *UsesClauseItem

func (UsesClause) IdentList

func (s UsesClause) IdentList() IdentList

func (UsesClause) Units

func (s UsesClause) Units() Units

type UsesClauseItem

type UsesClauseItem struct {
	*Ident
	Path *string
	Unit *Unit
	astcore.DeclNode
}

func NewUnitRef

func NewUnitRef(name interface{}, paths ...string) *UsesClauseItem

func (*UsesClauseItem) Children

func (m *UsesClauseItem) Children() Nodes

func (*UsesClauseItem) EffectivePath

func (m *UsesClauseItem) EffectivePath() string

func (*UsesClauseItem) ToDeclarations

func (m *UsesClauseItem) ToDeclarations() astcore.Decls

func (*UsesClauseItem) UnquotedPath

func (m *UsesClauseItem) UnquotedPath() string

type ValueFactor

type ValueFactor struct {
	Value string
}

func NewValueFactor

func NewValueFactor(v string) *ValueFactor

func (*ValueFactor) Children

func (*ValueFactor) Children() Nodes

type VarDecl

type VarDecl struct {
	IdentList
	Type                 Type
	Absolute             VarDeclAbsolute
	ConstExpr            *ConstExpr
	PortabilityDirective *PortabilityDirective
}

- VarDecl

  • (On Windows) ``` IdentList ':' Type [(ABSOLUTE (Ident | ConstExpr)) | '=' ConstExpr] PortabilityDirective ```
  • On Linux ``` IdentList ':' Type [ABSOLUTE (Ident) | '=' ConstExpr] PortabilityDirective ```

func (*VarDecl) Children

func (m *VarDecl) Children() Nodes

func (*VarDecl) ToDeclarations

func (m *VarDecl) ToDeclarations() astcore.Decls

type VarDeclAbsolute

type VarDeclAbsolute interface {
	Node
	// contains filtered or unexported methods
}

type VarDeclAbsoluteConstExpr

type VarDeclAbsoluteConstExpr ConstExpr

type VarDeclAbsoluteIdent

type VarDeclAbsoluteIdent Ident

func NewVarDeclAbsoluteIdent

func NewVarDeclAbsoluteIdent(arg interface{}) *VarDeclAbsoluteIdent

func (*VarDeclAbsoluteIdent) Children

func (*VarDeclAbsoluteIdent) Children() Nodes

type VarSection

type VarSection []*VarDecl
  • VarSection ``` VAR (VarDecl ';')... ```

func (VarSection) Children

func (s VarSection) Children() Nodes

func (VarSection) GetDeclNodes

func (s VarSection) GetDeclNodes() astcore.DeclNodes

type VariantSection

type VariantSection struct {
	Ident       *Ident
	TypeId      OrdinalType
	RecVariants RecVariants
}
  • VariantSection ``` CASE [Ident ':'] TypeId OF RecVariant ';'... ```

func (*VariantSection) Children

func (m *VariantSection) Children() Nodes

type VariantType

type VariantType interface {
	Type
	IsVariantType() bool
}
  • VariantType ``` VARIANT ``` ``` OLEVARIANT ```

type WhileStmt

type WhileStmt struct {
	Condition *Expression
	Statement *Statement
}
  • WhileStmt ``` WHILE Expression DO Statement ```

func (*WhileStmt) Children

func (m *WhileStmt) Children() Nodes

type WithStmt

type WithStmt struct {
	Objects   QualIds
	Statement *Statement
}
  • WithStmt ``` WITH IdentList DO Statement ``` Ident in IdentList doesn't have Ref to Declaration. So we use QualIds instead.

func (*WithStmt) Children

func (m *WithStmt) Children() Nodes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL