ast

package
v0.0.0-...-9af48e7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inspect

func Inspect(node AstNode, f func(AstNode) bool)

Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil).

func Walk

func Walk(v Visitor, node AstNode)

Types

type ADT

type ADT struct {
	Name string    `json:"name"`
	Args []ASTType `json:"type_args"`
}

type ADTValLiteral

type ADTValLiteral struct {
}

type ASTType

type ASTType interface {
	AstNode
	// contains filtered or unexported methods
}

type AcceptPaymentStatement

type AcceptPaymentStatement struct {
	AnnotatedNode
}

type AnnotatedNode

type AnnotatedNode struct {
	Loc *Location `json:"loc"`
}

type AppExpression

type AppExpression struct {
	AnnotatedNode
	Lhs     *Identifier   `json:"lhs"`
	RhsList []*Identifier `json:"rhs_list"`
}

type AstNode

type AstNode interface {
}

type BNumLiteral

type BNumLiteral struct {
	Val string `json:"value"`
}

type BindStatement

type BindStatement struct {
	AnnotatedNode
	Lhs     *Identifier `json:"lhs"`
	RhsExpr Expression  `json:"rhs_expr"`
}

func (*BindStatement) UnmarshalJSON

func (bs *BindStatement) UnmarshalJSON(b []byte) error

type BinderPattern

type BinderPattern struct {
	Variable *Identifier `json:"variable"`
}

type Builtin

type Builtin struct {
	Loc       *Location `json:"loc"`
	BuiltinOp string    `json:"builtin_operator"`
}

type BuiltinExpression

type BuiltinExpression struct {
	AnnotatedNode
	Args        []*Identifier `json:"arguments"`
	BuintinFunc *Builtin      `json:"builtin_function"`
}

type ByStrLiteral

type ByStrLiteral struct {
	Val string `json:"value"`
}

type ByStrXLiteral

type ByStrXLiteral struct {
	Val string `json:"value"`
}

type CallProcStatement

type CallProcStatement struct {
	AnnotatedNode
	Arg      *Identifier   `json:"arg"`
	Messages []*Identifier `json:"messages"`
}

type Component

type Component struct {
	ComponentType string       `json:"component_type"`
	Name          *Identifier  `json:"name"`
	Params        []*Parameter `json:"params"`
	Body          []Statement  `json:"body"`
}

func (*Component) UnmarshalJSON

func (comp *Component) UnmarshalJSON(b []byte) error

type ConstrExpression

type ConstrExpression struct {
	AnnotatedNode
	Types           []ASTType     `json:"types"`
	ConstructorName string        `json:"constructor_name"`
	Args            []*Identifier `json:"args"`
}

func (*ConstrExpression) UnmarshalJSON

func (ce *ConstrExpression) UnmarshalJSON(b []byte) error

type ConstructorPattern

type ConstructorPattern struct {
	ConstrName string    `json:"constructor_name"`
	Pats       []Pattern `json:"patterns"`
}

func (*ConstructorPattern) UnmarshalJSON

func (cp *ConstructorPattern) UnmarshalJSON(b []byte) error

type Contract

type Contract struct {
	Name       *Identifier  `json:"name"`
	Params     []*Parameter `json:"params"`
	Fields     []*Field     `json:"fields"`
	Components []*Component `json:"components"`
}

type ContractModule

type ContractModule struct {
	ScillaMajorVersion int               `json:"scilla_major_version"`
	Name               *Identifier       `json:"name"`
	Library            *Library          `json:"library"` // Optional
	ELibs              []ExternalLibrary `json:"external_libraries"`
	Contr              *Contract         `json:"contract"`
}

type CreateEvntStatement

type CreateEvntStatement struct {
	AnnotatedNode
	Arg *Identifier `json:"arg"`
}

type CtrDef

type CtrDef struct {
	CDName    *Identifier `json:"ctr_def_name"`
	CArgTypes []ASTType   `json:"c_arg_types"`
}

func (*CtrDef) UnmarshalJSON

func (cd *CtrDef) UnmarshalJSON(b []byte) error

type Expression

type Expression interface {
	AstNode
	// contains filtered or unexported methods
}

type ExternalLibrary

type ExternalLibrary struct {
	Name  *Identifier `json:"name"`
	Alias *Identifier `json:"alias"` // Optional

}

type Field

type Field struct {
	Name *Identifier `json:"field_name"`
	Type ASTType     `json:"field_type"`
	Expr Expression  `json:"expression"`
}

func (*Field) UnmarshalJSON

func (f *Field) UnmarshalJSON(b []byte) error

type FixpointExpression

type FixpointExpression struct {
	AnnotatedNode
}

type FunExpression

type FunExpression struct {
	AnnotatedNode
	Lhs     *Identifier `json:"lhs"`
	RhsExpr Expression  `json:"rhs_expr"`
	LhsType ASTType     `json:"lhs_type"`
}

func (*FunExpression) UnmarshalJSON

func (fe *FunExpression) UnmarshalJSON(b []byte) error

type FunType

type FunType struct {
	ArgType ASTType `json:"arg_type"`
	ValType ASTType `json:"val_type"`
}

type Identifier

type Identifier struct {
	Loc *Location `json:"loc"`
	Id  string    `json:"identifier"`
}

type IntLiteral

type IntLiteral struct {
	Width int    `json:"width"`
	Val   string `json:"value"`
}

type LetExpression

type LetExpression struct {
	AnnotatedNode
	Var     *Identifier `json:"variable"`
	VarType ASTType     `json:"variable_type"` //Optional
	Expr    Expression  `json:"expression"`
	Body    Expression  `json:"body"`
}

func (*LetExpression) UnmarshalJSON

func (le *LetExpression) UnmarshalJSON(b []byte) error

type LibEntry

type LibEntry interface {
	AstNode
	// contains filtered or unexported methods
}

type Library

type Library struct {
	Name    *Identifier `json:"library_name"`
	Entries []LibEntry  `json:"library_entries"`
}

func (*Library) UnmarshalJSON

func (l *Library) UnmarshalJSON(b []byte) error

type LibraryModule

type LibraryModule struct {
	Library *Library          `json:"library"` // Optional
	ELibs   []ExternalLibrary `json:"external_libraries"`
}

type LibraryType

type LibraryType struct {
	Name    *Identifier `json:"name"`
	CtrDefs []*CtrDef   `json:"ctr_defs"`
}

type LibraryVariable

type LibraryVariable struct {
	Name    *Identifier `json:"name"`
	VarType ASTType     `json:"variable_type"` // Optional
	Expr    Expression  `json:"expression"`
}

func (*LibraryVariable) UnmarshalJSON

func (l *LibraryVariable) UnmarshalJSON(b []byte) error

type Literal

type Literal interface {
	AstNode
	// contains filtered or unexported methods
}

type LiteralExpression

type LiteralExpression struct {
	AnnotatedNode
	Val Literal `json:"value"`
}

func (*LiteralExpression) UnmarshalJSON

func (le *LiteralExpression) UnmarshalJSON(b []byte) error

type LoadStatement

type LoadStatement struct {
	AnnotatedNode
	Lhs *Identifier `json:"lhs"`
	Rhs *Identifier `json:"rhs"`
}

type Location

type Location struct {
	SourceFile string `json:"source_file"`
	Line       int    `json:"line"`
	Column     int    `json:"column"`
}

type MapGetStatement

type MapGetStatement struct {
	AnnotatedNode
	Name          *Identifier   `json:"map_name"`
	Lhs           *Identifier   `json:"lhs"`
	Keys          []*Identifier `json:"keys"`
	IsValRetrieve bool          `json:"is_value_retrieve"`
}

type MapLiteral

type MapLiteral struct {
	KeyType ASTType  `json:"key_type"`
	ValType ASTType  `json:"value_type"`
	MVals   []MapVal `json:"mvalues"`
}

func (*MapLiteral) UnmarshalJSON

func (ml *MapLiteral) UnmarshalJSON(b []byte) error

type MapType

type MapType struct {
	KeyType ASTType `json:"key_type"`
	ValType ASTType `json:"val_type"`
}

func (*MapType) UnmarshalJSON

func (mt *MapType) UnmarshalJSON(b []byte) error

type MapUpdateStatement

type MapUpdateStatement struct {
	AnnotatedNode
	Name *Identifier   `json:"map_name"`
	Rhs  *Identifier   `json:"rhs"` //Optional
	Keys []*Identifier `json:"keys"`
}

type MapVal

type MapVal struct {
	Key Literal `json:"key"`
	Val Literal `json:"value"`
}

type MatchExpression

type MatchExpression struct {
	AnnotatedNode
	Lhs   *Identifier            `json:"lhs"`
	Cases []*MatchExpressionCase `json:"cases"`
}

type MatchExpressionCase

type MatchExpressionCase struct {
	Pat  Pattern    `json:"pattern"`
	Expr Expression `json:"expression"`
}

func (*MatchExpressionCase) UnmarshalJSON

func (mec *MatchExpressionCase) UnmarshalJSON(b []byte) error

type MatchStatement

type MatchStatement struct {
	AnnotatedNode
	Arg   *Identifier           `json:"arg"`
	Cases []*MatchStatementCase `json:"cases"`
}

type MatchStatementCase

type MatchStatementCase struct {
	Pat  Pattern     `json:"pattern"`
	Body []Statement `json:"pattern_body"`
}

func (*MatchStatementCase) UnmarshalJSON

func (msc *MatchStatementCase) UnmarshalJSON(b []byte) error

type MessageArgument

type MessageArgument struct {
	Var string  `json:"variable"`
	Pl  Payload `json:"payload"`
}

func (*MessageArgument) UnmarshalJSON

func (ma *MessageArgument) UnmarshalJSON(b []byte) error

type MessageExpression

type MessageExpression struct {
	AnnotatedNode
	MArgs []*MessageArgument `json:"margs"`
}

type Module

type Module interface {
	AstNode
	// contains filtered or unexported methods
}

func Parse_mod

func Parse_mod(b []byte) (Module, error)

type Parameter

type Parameter struct {
	Name *Identifier `json:"parameter_name"`
	Type ASTType     `json:"parameter_type"`
}

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(b []byte) error

type Pattern

type Pattern interface {
	AstNode
	// contains filtered or unexported methods
}

type Payload

type Payload interface {
	AstNode
	// contains filtered or unexported methods
}

type PayloadLiteral

type PayloadLiteral struct {
	Lit Literal `json:"literal"`
}

func (*PayloadLiteral) UnmarshalJSON

func (pll *PayloadLiteral) UnmarshalJSON(b []byte) error

type PayloadVariable

type PayloadVariable struct {
	Val *Identifier `json:"value"`
}

type PolyFun

type PolyFun struct {
	TypeVal ASTType `json:"type_val"`
	Body    ASTType `json:"body_type"`
}

type PrimType

type PrimType struct {
	Name string `json:"name"`
}

type ReadFromBCStatement

type ReadFromBCStatement struct {
	AnnotatedNode
	Lhs    *Identifier `json:"lhs"`
	RhsStr string      `json:"rhs_str"`
}

type SendMsgsStatement

type SendMsgsStatement struct {
	AnnotatedNode
	Arg *Identifier `json:"arg"`
}

type Statement

type Statement interface {
	AstNode
	// contains filtered or unexported methods
}

type StoreStatement

type StoreStatement struct {
	AnnotatedNode
	Lhs *Identifier `json:"lhs"`
	Rhs *Identifier `json:"rhs"`
}

type StringLiteral

type StringLiteral struct {
	Val string `json:"value"`
}

type TAppExpression

type TAppExpression struct {
	AnnotatedNode
}

type TFunExpression

type TFunExpression struct {
	AnnotatedNode
}

type ThrowStatement

type ThrowStatement struct {
	AnnotatedNode
	Arg *Identifier `json:"arg"` // Optional
}

type TypeVar

type TypeVar struct {
	Name string `json:"name"`
}

type UintLiteral

type UintLiteral struct {
	Width int    `json:"width"`
	Val   string `json:"value"`
}

type Unit

type Unit struct {
}

type VarExpression

type VarExpression struct {
	AnnotatedNode
	Var *Identifier `json:"variable"`
}

type Visitor

type Visitor interface {
	Visit(node AstNode) (w Visitor)
}

type WildcardPattern

type WildcardPattern struct {
}

Jump to

Keyboard shortcuts

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