Documentation
¶
Index ¶
- Constants
- type AppCall
- type BinaryOperation
- type BinaryOperator
- type Block
- type BooleanLiteral
- type Break
- type Call
- type CompareOperator
- type Comparison
- type Continue
- type Copy
- type DataType
- type Else
- type Exists
- type Expression
- type For
- type FunctionCall
- type FunctionDefinition
- func (e FunctionDefinition) Body() []Statement
- func (e FunctionDefinition) Name() string
- func (e FunctionDefinition) Params() []Variable
- func (e FunctionDefinition) Public() bool
- func (e FunctionDefinition) ReturnTypes() []ValueType
- func (e FunctionDefinition) StatementType() StatementType
- func (e FunctionDefinition) ValueType() ValueType
- type Global
- type Group
- type If
- type IfBranch
- type Input
- type IntegerLiteral
- type Itoa
- type Len
- type LogicalOperation
- type LogicalOperator
- type Operation
- type Panic
- type Parser
- type Print
- type Program
- type Read
- type Return
- type SliceAssignment
- type SliceEvaluation
- type SliceInstantiation
- type Statement
- type StatementType
- type StringLiteral
- type StringSubscript
- type UnaryOperation
- type UnaryOperator
- type ValueType
- type Variable
- type VariableAssignment
- type VariableAssignmentCallAssignment
- type VariableDefinition
- type VariableDefinitionCallAssignment
- type VariableEvaluation
- type Write
Constants ¶
View Source
const ( SCOPE_PROGRAM scope = "program" SCOPE_FUNCTION scope = "function" SCOPE_IF scope = "if" SCOPE_FOR scope = "for" SCOPE_SWITCH scope = "switch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppCall ¶
type AppCall struct {
// contains filtered or unexported fields
}
func (AppCall) Args ¶
func (a AppCall) Args() []Expression
func (AppCall) ReturnTypes ¶
func (AppCall) StatementType ¶
func (a AppCall) StatementType() StatementType
type BinaryOperation ¶
type BinaryOperation struct {
// contains filtered or unexported fields
}
func (BinaryOperation) Left ¶
func (b BinaryOperation) Left() Expression
func (BinaryOperation) Operator ¶
func (b BinaryOperation) Operator() BinaryOperator
func (BinaryOperation) Right ¶
func (b BinaryOperation) Right() Expression
func (BinaryOperation) StatementType ¶
func (b BinaryOperation) StatementType() StatementType
func (BinaryOperation) ValueType ¶
func (b BinaryOperation) ValueType() ValueType
type BinaryOperator ¶
type BinaryOperator = string
const ( BINARY_OPERATOR_MULTIPLICATION BinaryOperator = "*" BINARY_OPERATOR_DIVISION BinaryOperator = "/" BINARY_OPERATOR_MODULO BinaryOperator = "%" BINARY_OPERATOR_ADDITION BinaryOperator = "+" BINARY_OPERATOR_SUBTRACTION BinaryOperator = "-" )
type BooleanLiteral ¶
type BooleanLiteral struct {
// contains filtered or unexported fields
}
func (BooleanLiteral) StatementType ¶
func (l BooleanLiteral) StatementType() StatementType
func (BooleanLiteral) Value ¶
func (l BooleanLiteral) Value() bool
func (BooleanLiteral) ValueType ¶
func (l BooleanLiteral) ValueType() ValueType
type Break ¶
type Break struct {
}
func (Break) StatementType ¶
func (b Break) StatementType() StatementType
type Call ¶
type Call interface {
Expression
Name() string
Args() []Expression
ReturnTypes() []ValueType
}
type CompareOperator ¶
type CompareOperator = string
const ( COMPARE_OPERATOR_EQUAL CompareOperator = "==" COMPARE_OPERATOR_NOT_EQUAL CompareOperator = "!=" COMPARE_OPERATOR_LESS CompareOperator = "<" COMPARE_OPERATOR_LESS_OR_EQUAL CompareOperator = "<=" COMPARE_OPERATOR_GREATER CompareOperator = ">" COMPARE_OPERATOR_GREATER_OR_EQUAL CompareOperator = ">=" )
type Comparison ¶
type Comparison struct {
// contains filtered or unexported fields
}
func NewComparison ¶
func NewComparison(left Expression, operator CompareOperator, right Expression) Comparison
func (Comparison) Left ¶
func (c Comparison) Left() Expression
func (Comparison) Operator ¶
func (c Comparison) Operator() CompareOperator
func (Comparison) Right ¶
func (c Comparison) Right() Expression
func (Comparison) StatementType ¶
func (c Comparison) StatementType() StatementType
func (Comparison) ValueType ¶
func (c Comparison) ValueType() ValueType
type Continue ¶
type Continue struct {
}
func (Continue) StatementType ¶
func (c Continue) StatementType() StatementType
type Copy ¶
type Copy struct {
// contains filtered or unexported fields
}
func (Copy) Destination ¶
func (Copy) Source ¶
func (c Copy) Source() Expression
func (Copy) StatementType ¶
func (c Copy) StatementType() StatementType
type Exists ¶
type Exists struct {
// contains filtered or unexported fields
}
func (Exists) Path ¶
func (e Exists) Path() Expression
func (Exists) StatementType ¶
func (e Exists) StatementType() StatementType
type Expression ¶
type For ¶
type For struct {
// contains filtered or unexported fields
}
func (For) Condition ¶
func (f For) Condition() Expression
func (For) StatementType ¶
func (f For) StatementType() StatementType
type FunctionCall ¶
type FunctionCall struct {
// contains filtered or unexported fields
}
func (FunctionCall) Args ¶
func (e FunctionCall) Args() []Expression
func (FunctionCall) Name ¶
func (e FunctionCall) Name() string
func (FunctionCall) ReturnTypes ¶
func (e FunctionCall) ReturnTypes() []ValueType
func (FunctionCall) StatementType ¶
func (e FunctionCall) StatementType() StatementType
func (FunctionCall) ValueType ¶
func (e FunctionCall) ValueType() ValueType
type FunctionDefinition ¶
type FunctionDefinition struct {
// contains filtered or unexported fields
}
func (FunctionDefinition) Body ¶
func (e FunctionDefinition) Body() []Statement
func (FunctionDefinition) Name ¶
func (e FunctionDefinition) Name() string
func (FunctionDefinition) Params ¶
func (e FunctionDefinition) Params() []Variable
func (FunctionDefinition) Public ¶
func (e FunctionDefinition) Public() bool
func (FunctionDefinition) ReturnTypes ¶
func (e FunctionDefinition) ReturnTypes() []ValueType
func (FunctionDefinition) StatementType ¶
func (e FunctionDefinition) StatementType() StatementType
func (FunctionDefinition) ValueType ¶
func (e FunctionDefinition) ValueType() ValueType
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (Group) Child ¶
func (e Group) Child() Expression
func (Group) StatementType ¶
func (e Group) StatementType() StatementType
type If ¶
type If struct {
// contains filtered or unexported fields
}
func (If) ElseIfBranches ¶
func (If) StatementType ¶
func (i If) StatementType() StatementType
type IfBranch ¶
type IfBranch struct {
// contains filtered or unexported fields
}
func (IfBranch) Condition ¶
func (b IfBranch) Condition() Expression
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
func (Input) Prompt ¶
func (i Input) Prompt() Expression
func (Input) StatementType ¶
func (i Input) StatementType() StatementType
type IntegerLiteral ¶
type IntegerLiteral struct {
// contains filtered or unexported fields
}
func (IntegerLiteral) StatementType ¶
func (l IntegerLiteral) StatementType() StatementType
func (IntegerLiteral) Value ¶
func (l IntegerLiteral) Value() int
func (IntegerLiteral) ValueType ¶
func (l IntegerLiteral) ValueType() ValueType
type Itoa ¶
type Itoa struct {
// contains filtered or unexported fields
}
func (Itoa) StatementType ¶
func (e Itoa) StatementType() StatementType
func (Itoa) Value ¶
func (e Itoa) Value() Expression
type Len ¶
type Len struct {
// contains filtered or unexported fields
}
func (Len) Expression ¶
func (l Len) Expression() Expression
func (Len) StatementType ¶
func (l Len) StatementType() StatementType
type LogicalOperation ¶
type LogicalOperation struct {
// contains filtered or unexported fields
}
func (LogicalOperation) Left ¶
func (l LogicalOperation) Left() Expression
func (LogicalOperation) Operator ¶
func (l LogicalOperation) Operator() LogicalOperator
func (LogicalOperation) Right ¶
func (l LogicalOperation) Right() Expression
func (LogicalOperation) StatementType ¶
func (l LogicalOperation) StatementType() StatementType
func (LogicalOperation) ValueType ¶
func (l LogicalOperation) ValueType() ValueType
type LogicalOperator ¶
type LogicalOperator = string
const ( LOGICAL_OPERATOR_AND LogicalOperator = "&&" LOGICAL_OPERATOR_OR LogicalOperator = "||" )
type Operation ¶
type Operation interface {
Left() Expression
Operator() string
Right() Expression
}
type Panic ¶
type Panic struct {
// contains filtered or unexported fields
}
func (Panic) Expression ¶
func (p Panic) Expression() Expression
func (Panic) StatementType ¶
func (p Panic) StatementType() StatementType
type Print ¶
type Print struct {
// contains filtered or unexported fields
}
func (Print) Expressions ¶
func (p Print) Expressions() []Expression
func (Print) StatementType ¶
func (p Print) StatementType() StatementType
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func (Program) StatementType ¶
func (p Program) StatementType() StatementType
type Read ¶
type Read struct {
// contains filtered or unexported fields
}
func (Read) Path ¶
func (r Read) Path() Expression
func (Read) StatementType ¶
func (r Read) StatementType() StatementType
type Return ¶
type Return struct {
// contains filtered or unexported fields
}
func (Return) StatementType ¶
func (r Return) StatementType() StatementType
func (Return) Values ¶
func (r Return) Values() []Expression
type SliceAssignment ¶
type SliceAssignment struct {
Variable
// contains filtered or unexported fields
}
func (SliceAssignment) Index ¶
func (s SliceAssignment) Index() Expression
func (SliceAssignment) Name ¶
func (s SliceAssignment) Name() string
func (SliceAssignment) StatementType ¶
func (s SliceAssignment) StatementType() StatementType
func (SliceAssignment) Value ¶
func (s SliceAssignment) Value() Expression
type SliceEvaluation ¶
type SliceEvaluation struct {
// contains filtered or unexported fields
}
func (SliceEvaluation) Index ¶
func (s SliceEvaluation) Index() Expression
func (SliceEvaluation) StatementType ¶
func (s SliceEvaluation) StatementType() StatementType
func (SliceEvaluation) Value ¶
func (s SliceEvaluation) Value() Expression
func (SliceEvaluation) ValueType ¶
func (s SliceEvaluation) ValueType() ValueType
type SliceInstantiation ¶
type SliceInstantiation struct {
// contains filtered or unexported fields
}
func (SliceInstantiation) StatementType ¶
func (s SliceInstantiation) StatementType() StatementType
func (SliceInstantiation) ValueType ¶
func (s SliceInstantiation) ValueType() ValueType
func (SliceInstantiation) Values ¶
func (s SliceInstantiation) Values() []Expression
type Statement ¶
type Statement interface {
StatementType() StatementType
}
type StatementType ¶
type StatementType string
const ( STATEMENT_TYPE_PROGRAM StatementType = "program" STATEMENT_TYPE_BOOL_LITERAL StatementType = "boolean" STATEMENT_TYPE_INT_LITERAL StatementType = "integer" STATEMENT_TYPE_STRING_LITERAL StatementType = "string" STATEMENT_TYPE_STRING_SUBSCRIPT StatementType = "string subscript" STATEMENT_TYPE_NIL_LITERAL StatementType = "nil" STATEMENT_TYPE_UNARY_OPERATION StatementType = "unary operation" STATEMENT_TYPE_BINARY_OPERATION StatementType = "binary operation" STATEMENT_TYPE_LOGICAL_OPERATION StatementType = "logical operation" STATEMENT_TYPE_COMPARISON StatementType = "comparison" STATEMENT_TYPE_VAR_DEFINITION StatementType = "variable definition" STATEMENT_TYPE_VAR_DEFINITION_CALL_ASSIGNMENT StatementType = "variable definition func assignment" STATEMENT_TYPE_VAR_ASSIGNMENT StatementType = "variable assignment" STATEMENT_TYPE_VAR_ASSIGNMENT_CALL_ASSIGNMENT StatementType = "variable assignment func assignment" STATEMENT_TYPE_VAR_EVALUATION StatementType = "variable evaluation" STATEMENT_TYPE_GROUP StatementType = "group" STATEMENT_TYPE_FUNCTION_DEFINITION StatementType = "function definition" STATEMENT_TYPE_FUNCTION_CALL StatementType = "function call" STATEMENT_TYPE_APP_CALL StatementType = "app call" STATEMENT_TYPE_RETURN StatementType = "return" STATEMENT_TYPE_IF StatementType = "if" STATEMENT_TYPE_FOR StatementType = "for" STATEMENT_TYPE_FOR_RANGE StatementType = "for range" STATEMENT_TYPE_BREAK StatementType = "break" STATEMENT_TYPE_CONTINUE StatementType = "continue" STATEMENT_TYPE_INSTANTIATION StatementType = "instantiation" STATEMENT_TYPE_PRINT StatementType = "print" STATEMENT_TYPE_ITOA StatementType = "itoa" STATEMENT_TYPE_EXISTS StatementType = "exists" STATEMENT_TYPE_PANIC StatementType = "panic" STATEMENT_TYPE_LEN StatementType = "len" STATEMENT_TYPE_INPUT StatementType = "input" STATEMENT_TYPE_COPY StatementType = "copy" STATEMENT_TYPE_READ StatementType = "read" STATEMENT_TYPE_WRITE StatementType = "write" STATEMENT_TYPE_SLICE_INSTANTIATION StatementType = "slice instantiation" STATEMENT_TYPE_SLICE_ASSIGNMENT StatementType = "slice assignment" STATEMENT_TYPE_SLICE_EVALUATION StatementType = "slice evaluation" )
type StringLiteral ¶
type StringLiteral struct {
// contains filtered or unexported fields
}
func (StringLiteral) StatementType ¶
func (l StringLiteral) StatementType() StatementType
func (StringLiteral) Value ¶
func (l StringLiteral) Value() string
func (StringLiteral) ValueType ¶
func (l StringLiteral) ValueType() ValueType
type StringSubscript ¶
type StringSubscript struct {
// contains filtered or unexported fields
}
func (StringSubscript) EndIndex ¶
func (s StringSubscript) EndIndex() Expression
func (StringSubscript) StartIndex ¶
func (s StringSubscript) StartIndex() Expression
func (StringSubscript) StatementType ¶
func (s StringSubscript) StatementType() StatementType
func (StringSubscript) Value ¶
func (s StringSubscript) Value() Expression
func (StringSubscript) ValueType ¶
func (s StringSubscript) ValueType() ValueType
type UnaryOperation ¶
type UnaryOperation struct {
// contains filtered or unexported fields
}
func (UnaryOperation) Expression ¶
func (b UnaryOperation) Expression() Expression
func (UnaryOperation) Operator ¶
func (b UnaryOperation) Operator() UnaryOperator
func (UnaryOperation) StatementType ¶
func (b UnaryOperation) StatementType() StatementType
func (UnaryOperation) ValueType ¶
func (b UnaryOperation) ValueType() ValueType
type UnaryOperator ¶
type UnaryOperator = string
const (
UNARY_OPERATOR_NEGATE UnaryOperator = "!"
)
type ValueType ¶
type ValueType struct {
// contains filtered or unexported fields
}
func NewValueType ¶
type Variable ¶
type Variable struct {
// contains filtered or unexported fields
}
func NewVariable ¶
type VariableAssignment ¶
type VariableAssignment struct {
// contains filtered or unexported fields
}
func (VariableAssignment) StatementType ¶
func (v VariableAssignment) StatementType() StatementType
func (VariableAssignment) Values ¶
func (v VariableAssignment) Values() []Expression
func (VariableAssignment) Variables ¶
func (v VariableAssignment) Variables() []Variable
type VariableAssignmentCallAssignment ¶
type VariableAssignmentCallAssignment struct {
// contains filtered or unexported fields
}
func (VariableAssignmentCallAssignment) Call ¶
func (v VariableAssignmentCallAssignment) Call() Call
func (VariableAssignmentCallAssignment) StatementType ¶
func (v VariableAssignmentCallAssignment) StatementType() StatementType
func (VariableAssignmentCallAssignment) Variables ¶
func (v VariableAssignmentCallAssignment) Variables() []Variable
type VariableDefinition ¶
type VariableDefinition struct {
// contains filtered or unexported fields
}
func (VariableDefinition) StatementType ¶
func (v VariableDefinition) StatementType() StatementType
func (VariableDefinition) Values ¶
func (v VariableDefinition) Values() []Expression
func (VariableDefinition) Variables ¶
func (v VariableDefinition) Variables() []Variable
type VariableDefinitionCallAssignment ¶
type VariableDefinitionCallAssignment struct {
// contains filtered or unexported fields
}
func (VariableDefinitionCallAssignment) Call ¶
func (v VariableDefinitionCallAssignment) Call() Call
func (VariableDefinitionCallAssignment) StatementType ¶
func (v VariableDefinitionCallAssignment) StatementType() StatementType
func (VariableDefinitionCallAssignment) Variables ¶
func (v VariableDefinitionCallAssignment) Variables() []Variable
type VariableEvaluation ¶
type VariableEvaluation struct {
Variable
}
func (VariableEvaluation) StatementType ¶
func (e VariableEvaluation) StatementType() StatementType
type Write ¶
type Write struct {
// contains filtered or unexported fields
}
func (Write) Append ¶
func (w Write) Append() Expression
func (Write) Data ¶
func (w Write) Data() Expression
func (Write) Path ¶
func (w Write) Path() Expression
func (Write) StatementType ¶
func (w Write) StatementType() StatementType
Source Files
¶
- appcall.go
- binaryoperation.go
- block.go
- break.go
- call.go
- comparison.go
- continue.go
- copy.go
- exists.go
- expression.go
- for.go
- function.go
- global.go
- group.go
- if.go
- input.go
- itoa.go
- len.go
- literals.go
- logicaloperation.go
- operation.go
- panic.go
- parser.go
- print.go
- program.go
- read.go
- return.go
- slice.go
- statement.go
- string.go
- types.go
- unaryoperation.go
- variable.go
- write.go
Click to show internal directories.
Click to hide internal directories.