Documentation ¶
Index ¶
- type ASTBlock
- type ASTBreak
- type ASTCase
- type ASTComment
- type ASTContinue
- type ASTDefault
- type ASTDoWhile
- type ASTEnum
- type ASTEnumProperty
- type ASTExpressionBinary
- type ASTExpressionCast
- type ASTExpressionConditionalBinary
- type ASTExpressionEqualityBinary
- type ASTExpressionFunctionCall
- type ASTExpressionIndex
- type ASTExpressionLiteral
- type ASTExpressionParenthesized
- type ASTExpressionPointerPropertyAccess
- type ASTExpressionPropertyAccess
- type ASTExpressionTernary
- type ASTExpressionUnaryPost
- type ASTExpressionUnaryPre
- type ASTFor
- type ASTFunction
- func (f *ASTFunction) SetArgs(args []*ASTFunctionArgument) *ASTFunction
- func (f *ASTFunction) SetIsVariadic(isVariadic bool) *ASTFunction
- func (f *ASTFunction) SetReturnType(returnType *ASTType) *ASTFunction
- func (f *ASTFunction) String() string
- func (f *ASTFunction) TypeString(withName bool) string
- type ASTFunctionArgument
- type ASTFunctionReturn
- type ASTGoto
- type ASTIf
- type ASTLabel
- type ASTMultipleStatements
- type ASTStruct
- func (s *ASTStruct) GetProperty(name string) *ASTStructProperty
- func (s *ASTStruct) GetPropertyByIndex(index int) *ASTStructProperty
- func (s *ASTStruct) IsSameTo(other *ASTStruct) bool
- func (s *ASTStruct) SetProperties(properties []*ASTStructProperty) *ASTStruct
- func (s *ASTStruct) String() string
- func (s *ASTStruct) TypeString() string
- type ASTStructProperty
- type ASTSwitch
- type ASTType
- func (t *ASTType) IsArray() bool
- func (t *ASTType) IsConvertibleTo(targetType *ASTType) bool
- func (t *ASTType) IsFloat() bool
- func (t *ASTType) IsFunction() bool
- func (t *ASTType) IsInteger() bool
- func (t *ASTType) IsPointer() bool
- func (t *ASTType) IsSameTo(other *ASTType) bool
- func (t *ASTType) IsStruct() bool
- func (t *ASTType) IsVoid() bool
- func (t *ASTType) SetArraySize(expression IASTExpression) *ASTType
- func (t *ASTType) SetArrayType(arrayType *ASTType) *ASTType
- func (t *ASTType) SetFunctionType(functionType *ASTFunction) *ASTType
- func (t *ASTType) SetIsSigned(isSigned bool)
- func (t *ASTType) SetPointerType(pointerType *ASTType) *ASTType
- func (t *ASTType) SetStructType(structType *ASTStruct) *ASTType
- func (t *ASTType) String() string
- type ASTTypeConversion
- type ASTTypeKind
- type ASTTypedef
- type ASTVariableDeclaration
- type ASTVariableDeclarationItem
- type ASTWhile
- type AstArrayInitialization
- type AstStructInitialization
- type AstStructNamedInitialization
- type IASTExpression
- type IASTItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASTBlock ¶
type ASTBlock struct {
Statements []IASTItem
}
func NewASTBlock ¶
func (*ASTBlock) EndsWithBreak ¶
func (*ASTBlock) EndsWithReturn ¶
func (*ASTBlock) StringInner ¶
type ASTCase ¶
type ASTCase struct { Expression IASTExpression Block *ASTBlock }
func NewASTCase ¶
func NewASTCase(expression IASTExpression, block *ASTBlock) *ASTCase
func (*ASTCase) StringInner ¶
func (*ASTCase) StringJoined ¶
type ASTComment ¶
func NewASTComment ¶
func NewASTComment(multiLine bool, value string) *ASTComment
func (*ASTComment) String ¶
func (c *ASTComment) String() string
type ASTContinue ¶
type ASTContinue struct{}
func NewASTContinue ¶
func NewASTContinue() *ASTContinue
func (*ASTContinue) String ¶
func (b *ASTContinue) String() string
type ASTDefault ¶
type ASTDefault struct {
Block *ASTBlock
}
func NewASTDefault ¶
func NewASTDefault(block *ASTBlock) *ASTDefault
func (*ASTDefault) String ¶
func (i *ASTDefault) String() string
type ASTDoWhile ¶
type ASTDoWhile struct { Cond IASTExpression Then IASTItem }
func NewASTDoWhile ¶
func NewASTDoWhile(cond IASTExpression, then IASTItem) *ASTDoWhile
func (*ASTDoWhile) String ¶
func (w *ASTDoWhile) String() string
type ASTEnum ¶
type ASTEnum struct { Name string Properties []*ASTEnumProperty }
func NewASTEnum ¶
func NewASTEnum(name string, properties []*ASTEnumProperty) *ASTEnum
type ASTEnumProperty ¶
type ASTEnumProperty struct { Name string Expression IASTExpression }
func NewASTEnumProperty ¶
func NewASTEnumProperty(name string, expression IASTExpression) *ASTEnumProperty
func (*ASTEnumProperty) String ¶
func (m *ASTEnumProperty) String() string
type ASTExpressionBinary ¶
type ASTExpressionBinary struct { Left IASTExpression Operator string Right IASTExpression ReturnType *ASTType }
func NewASTExpressionBinary ¶
func NewASTExpressionBinary(left IASTExpression, operator string, right IASTExpression, returnType *ASTType) *ASTExpressionBinary
func (*ASTExpressionBinary) GetType ¶
func (e *ASTExpressionBinary) GetType() *ASTType
func (*ASTExpressionBinary) String ¶
func (e *ASTExpressionBinary) String() string
type ASTExpressionCast ¶
type ASTExpressionCast struct { Expression IASTExpression Type *ASTType }
func NewASTExpressionCast ¶
func NewASTExpressionCast(expression IASTExpression, typ *ASTType) *ASTExpressionCast
func (*ASTExpressionCast) GetType ¶
func (e *ASTExpressionCast) GetType() *ASTType
func (*ASTExpressionCast) String ¶
func (e *ASTExpressionCast) String() string
type ASTExpressionConditionalBinary ¶
type ASTExpressionConditionalBinary struct { Left IASTExpression Operator string Right IASTExpression }
func NewASTExpressionConditionalBinary ¶
func NewASTExpressionConditionalBinary(left IASTExpression, operator string, right IASTExpression) *ASTExpressionConditionalBinary
func (*ASTExpressionConditionalBinary) GetType ¶
func (e *ASTExpressionConditionalBinary) GetType() *ASTType
func (*ASTExpressionConditionalBinary) String ¶
func (e *ASTExpressionConditionalBinary) String() string
type ASTExpressionEqualityBinary ¶
type ASTExpressionEqualityBinary struct { Left IASTExpression Operator string Right IASTExpression }
func NewASTExpressionEqualityBinary ¶
func NewASTExpressionEqualityBinary(left IASTExpression, operator string, right IASTExpression) *ASTExpressionEqualityBinary
func (*ASTExpressionEqualityBinary) GetType ¶
func (e *ASTExpressionEqualityBinary) GetType() *ASTType
func (*ASTExpressionEqualityBinary) String ¶
func (e *ASTExpressionEqualityBinary) String() string
type ASTExpressionFunctionCall ¶
type ASTExpressionFunctionCall struct { Left IASTExpression Args []IASTExpression }
func NewASTExpressionFunctionCall ¶
func NewASTExpressionFunctionCall(left IASTExpression, args []IASTExpression) *ASTExpressionFunctionCall
func (*ASTExpressionFunctionCall) GetType ¶
func (e *ASTExpressionFunctionCall) GetType() *ASTType
func (*ASTExpressionFunctionCall) String ¶
func (e *ASTExpressionFunctionCall) String() string
type ASTExpressionIndex ¶
type ASTExpressionIndex struct { Left IASTExpression Index IASTExpression }
func NewASTExpressionIndex ¶
func NewASTExpressionIndex(left IASTExpression, index IASTExpression) *ASTExpressionIndex
func (*ASTExpressionIndex) GetType ¶
func (e *ASTExpressionIndex) GetType() *ASTType
func (*ASTExpressionIndex) String ¶
func (e *ASTExpressionIndex) String() string
type ASTExpressionLiteral ¶
func NewASTExpressionLiteral ¶
func NewASTExpressionLiteral(value string, typ_ *ASTType) *ASTExpressionLiteral
func (*ASTExpressionLiteral) GetType ¶
func (e *ASTExpressionLiteral) GetType() *ASTType
func (*ASTExpressionLiteral) String ¶
func (e *ASTExpressionLiteral) String() string
type ASTExpressionParenthesized ¶
type ASTExpressionParenthesized struct {
Expression IASTExpression
}
func NewAstExpressionParenthesized ¶
func NewAstExpressionParenthesized(expression IASTExpression) *ASTExpressionParenthesized
func (*ASTExpressionParenthesized) GetType ¶
func (e *ASTExpressionParenthesized) GetType() *ASTType
func (*ASTExpressionParenthesized) String ¶
func (e *ASTExpressionParenthesized) String() string
type ASTExpressionPointerPropertyAccess ¶
type ASTExpressionPointerPropertyAccess struct { Left IASTExpression Property *ASTStructProperty }
func NewASTExpressionPointerPropertyAccess ¶
func NewASTExpressionPointerPropertyAccess(left IASTExpression, property *ASTStructProperty) *ASTExpressionPointerPropertyAccess
func (*ASTExpressionPointerPropertyAccess) GetType ¶
func (e *ASTExpressionPointerPropertyAccess) GetType() *ASTType
func (*ASTExpressionPointerPropertyAccess) String ¶
func (e *ASTExpressionPointerPropertyAccess) String() string
type ASTExpressionPropertyAccess ¶
type ASTExpressionPropertyAccess struct { Left IASTExpression Property *ASTStructProperty }
func NewASTExpressionPropertyAccess ¶
func NewASTExpressionPropertyAccess(left IASTExpression, property *ASTStructProperty) *ASTExpressionPropertyAccess
func (*ASTExpressionPropertyAccess) GetType ¶
func (e *ASTExpressionPropertyAccess) GetType() *ASTType
func (*ASTExpressionPropertyAccess) String ¶
func (e *ASTExpressionPropertyAccess) String() string
type ASTExpressionTernary ¶
type ASTExpressionTernary struct { Cond IASTExpression True IASTExpression False IASTExpression IsStatement bool }
func NewASTExpressionTernary ¶
func NewASTExpressionTernary(cond IASTExpression, true_ IASTExpression, false_ IASTExpression, isStatement bool) *ASTExpressionTernary
func (*ASTExpressionTernary) GetType ¶
func (e *ASTExpressionTernary) GetType() *ASTType
func (*ASTExpressionTernary) String ¶
func (e *ASTExpressionTernary) String() string
type ASTExpressionUnaryPost ¶
type ASTExpressionUnaryPost struct { Operand IASTExpression Operator string IsStatement bool }
func NewASTExpressionUnaryPost ¶
func NewASTExpressionUnaryPost(operand IASTExpression, operator string, isStatement bool) *ASTExpressionUnaryPost
func (*ASTExpressionUnaryPost) GetType ¶
func (e *ASTExpressionUnaryPost) GetType() *ASTType
func (*ASTExpressionUnaryPost) String ¶
func (e *ASTExpressionUnaryPost) String() string
type ASTExpressionUnaryPre ¶
type ASTExpressionUnaryPre struct { Operator string Operand IASTExpression IsStatement bool }
func NewASTExpressionUnaryPre ¶
func NewASTExpressionUnaryPre(operator string, operand IASTExpression, isStatement bool) *ASTExpressionUnaryPre
func (*ASTExpressionUnaryPre) GetType ¶
func (e *ASTExpressionUnaryPre) GetType() *ASTType
func (*ASTExpressionUnaryPre) String ¶
func (e *ASTExpressionUnaryPre) String() string
type ASTFor ¶
type ASTFor struct { Init IASTItem Cond IASTExpression Post IASTExpression Statement IASTItem }
type ASTFunction ¶
type ASTFunction struct { Name string Args []*ASTFunctionArgument IsVariadic bool ReturnType *ASTType Body *ASTBlock }
func NewASTFunction ¶
func NewASTFunction(name string) *ASTFunction
func (*ASTFunction) SetArgs ¶
func (f *ASTFunction) SetArgs(args []*ASTFunctionArgument) *ASTFunction
func (*ASTFunction) SetIsVariadic ¶
func (f *ASTFunction) SetIsVariadic(isVariadic bool) *ASTFunction
func (*ASTFunction) SetReturnType ¶
func (f *ASTFunction) SetReturnType(returnType *ASTType) *ASTFunction
func (*ASTFunction) String ¶
func (f *ASTFunction) String() string
func (*ASTFunction) TypeString ¶
func (f *ASTFunction) TypeString(withName bool) string
type ASTFunctionArgument ¶
func NewASTFunctionArgument ¶
func NewASTFunctionArgument(name string, typ *ASTType) *ASTFunctionArgument
func (*ASTFunctionArgument) String ¶
func (a *ASTFunctionArgument) String() string
type ASTFunctionReturn ¶
type ASTFunctionReturn struct { Expression IASTExpression IsInMain bool }
func NewASTFunctionReturn ¶
func NewASTFunctionReturn(isInMain bool) *ASTFunctionReturn
func (*ASTFunctionReturn) SetExpression ¶
func (b *ASTFunctionReturn) SetExpression(expression IASTExpression)
func (*ASTFunctionReturn) String ¶
func (b *ASTFunctionReturn) String() string
type ASTIf ¶
type ASTIf struct { Condition IASTExpression Then IASTItem Else IASTItem }
func NewASTIf ¶
func NewASTIf(condition IASTExpression, then IASTItem) *ASTIf
type ASTMultipleStatements ¶
type ASTMultipleStatements struct {
Statements []IASTItem
}
func NewASTMultipleStatements ¶
func NewASTMultipleStatements(statements []IASTItem) *ASTMultipleStatements
func (*ASTMultipleStatements) String ¶
func (m *ASTMultipleStatements) String() string
type ASTStruct ¶
type ASTStruct struct { TypeId string Name string IsOpaque bool Properties []*ASTStructProperty }
func NewAstStructOpaque ¶
func (*ASTStruct) GetProperty ¶
func (s *ASTStruct) GetProperty(name string) *ASTStructProperty
func (*ASTStruct) GetPropertyByIndex ¶
func (s *ASTStruct) GetPropertyByIndex(index int) *ASTStructProperty
func (*ASTStruct) SetProperties ¶
func (s *ASTStruct) SetProperties(properties []*ASTStructProperty) *ASTStruct
func (*ASTStruct) TypeString ¶
type ASTStructProperty ¶
func NewASTStructProperty ¶
func NewASTStructProperty(name string, typ *ASTType) *ASTStructProperty
func (*ASTStructProperty) GetTranslatedName ¶
func (p *ASTStructProperty) GetTranslatedName() string
func (*ASTStructProperty) String ¶
func (m *ASTStructProperty) String() string
type ASTSwitch ¶
type ASTSwitch struct { Expression IASTExpression Cases []*ASTCase DefaultCase *ASTDefault }
func NewASTSwitch ¶
func NewASTSwitch(expression IASTExpression) *ASTSwitch
func (*ASTSwitch) SetDefaultCase ¶
func (s *ASTSwitch) SetDefaultCase(defaultCase *ASTDefault)
type ASTType ¶
type ASTType struct { Kind ASTTypeKind Name string IsSigned bool ArrayType *ASTType ArraySize IASTExpression PointerType *ASTType FunctionType *ASTFunction StructType *ASTStruct }
func NewASTType ¶
func NewASTType(kind ASTTypeKind, name string) *ASTType
func (*ASTType) IsConvertibleTo ¶
func (*ASTType) IsFunction ¶
func (*ASTType) SetArraySize ¶
func (t *ASTType) SetArraySize(expression IASTExpression) *ASTType
func (*ASTType) SetArrayType ¶
func (*ASTType) SetFunctionType ¶
func (t *ASTType) SetFunctionType(functionType *ASTFunction) *ASTType
func (*ASTType) SetIsSigned ¶
func (*ASTType) SetPointerType ¶
func (*ASTType) SetStructType ¶
type ASTTypeConversion ¶
type ASTTypeConversion struct { Expression IASTExpression TargetType *ASTType }
func NewAstTypeConversion ¶
func NewAstTypeConversion(expression IASTExpression, targetType *ASTType) (*ASTTypeConversion, error)
func (*ASTTypeConversion) GetType ¶
func (t *ASTTypeConversion) GetType() *ASTType
func (*ASTTypeConversion) String ¶
func (t *ASTTypeConversion) String() string
type ASTTypeKind ¶
type ASTTypeKind int64
const ( ASTTypeKindAny ASTTypeKind = iota ASTTypeKindVoid ASTTypeKindInt ASTTypeKindInt16 ASTTypeKindInt64 ASTTypeKindChar ASTTypeKindByte ASTTypeKindFloat32 ASTTypeKindFloat64 ASTTypeKindBool ASTTypeKindArray ASTTypeKindPointer ASTTypeKindStruct ASTTypeKindFunction )
type ASTTypedef ¶
func NewASTTypedef ¶
func NewASTTypedef(name string, typ *ASTType) *ASTTypedef
func (*ASTTypedef) String ¶
func (t *ASTTypedef) String() string
type ASTVariableDeclaration ¶
type ASTVariableDeclaration struct { IsStatement bool ForceFullDeclaration bool Items []*ASTVariableDeclarationItem }
func NewASTVariableDeclaration ¶
func NewASTVariableDeclaration(isStatement bool) *ASTVariableDeclaration
func (*ASTVariableDeclaration) SetForceFullDeclaration ¶
func (v *ASTVariableDeclaration) SetForceFullDeclaration(forceFullDeclaration bool) *ASTVariableDeclaration
func (*ASTVariableDeclaration) String ¶
func (v *ASTVariableDeclaration) String() string
func (*ASTVariableDeclaration) StringStatement ¶
func (v *ASTVariableDeclaration) StringStatement() string
type ASTVariableDeclarationItem ¶
type ASTVariableDeclarationItem struct { Name string Type *ASTType Expression IASTExpression }
func NewASTVariableDeclarationItem ¶
func NewASTVariableDeclarationItem(name string, typ *ASTType, expression IASTExpression) *ASTVariableDeclarationItem
type ASTWhile ¶
type ASTWhile struct { Cond IASTExpression Then IASTItem }
func NewASTWhile ¶
func NewASTWhile(cond IASTExpression, then IASTItem) *ASTWhile
type AstArrayInitialization ¶
type AstArrayInitialization struct { Type *ASTType Fields []IASTExpression }
func NewAstArrayInitialization ¶
func NewAstArrayInitialization(typ *ASTType, fields []IASTExpression) *AstArrayInitialization
func (*AstArrayInitialization) GetType ¶
func (e *AstArrayInitialization) GetType() *ASTType
func (*AstArrayInitialization) String ¶
func (e *AstArrayInitialization) String() string
type AstStructInitialization ¶
type AstStructInitialization struct { Struct *ASTType Fields []IASTExpression }
func NewAstStructInitialization ¶
func NewAstStructInitialization(typ *ASTType, fields []IASTExpression) *AstStructInitialization
func (*AstStructInitialization) GetType ¶
func (e *AstStructInitialization) GetType() *ASTType
func (*AstStructInitialization) String ¶
func (e *AstStructInitialization) String() string
type AstStructNamedInitialization ¶
type AstStructNamedInitialization struct { Struct *ASTType Names []string Expressions []IASTExpression }
func NewAstStructNamedInitialization ¶
func NewAstStructNamedInitialization(typ *ASTType, names []string, expressions []IASTExpression) *AstStructNamedInitialization
func (*AstStructNamedInitialization) GetType ¶
func (s *AstStructNamedInitialization) GetType() *ASTType
func (*AstStructNamedInitialization) String ¶
func (e *AstStructNamedInitialization) String() string
type IASTExpression ¶
func EnsureConditionalValidity ¶
func EnsureConditionalValidity(expression IASTExpression) IASTExpression
Source Files ¶
- array_initialization.go
- block.go
- break.go
- case.go
- comment.go
- continue.go
- default.go
- do_while.go
- enum.go
- expression.go
- expression_binary.go
- expression_cast.go
- expression_conditional.go
- expression_conditional_binary.go
- expression_equality_binary.go
- expression_function_call.go
- expression_index.go
- expression_literal.go
- expression_parenthesized.go
- expression_pointer_property_access.go
- expression_property_access.go
- expression_unary_post.go
- expression_unary_pre.go
- for.go
- function.go
- goto.go
- if.go
- item.go
- label.go
- return.go
- statements.go
- struct.go
- struct_initialization.go
- struct_named_initialization.go
- switch.go
- ternary.go
- type.go
- type_convertion.go
- typedef.go
- variable.go
- while.go
Click to show internal directories.
Click to hide internal directories.