Documentation ¶
Overview ¶
Package syntax defines the the MRO pipeline declaration language.
This includes the grammar and AST definition, as well as the parsers, preprocessors, and formatters for it.
Index ¶
- Constants
- func DefiningFile(node AstNodable) string
- func Format(src, filename string) (string, error)
- func FormatFile(filename string) (string, error)
- func JsonDumpAsts(asts []*Ast) string
- func SearchPipestanceParams(pipestance *Ast, what string) interface{}
- func SetEnforcementLevel(level LanguageEnforceLevel)
- type Ast
- type AstError
- type AstNodable
- type AstNode
- type BindStm
- type BindStms
- type BuiltinType
- type CallStm
- type Callable
- type Callables
- type Dec
- type ErrorList
- type Exp
- type ExpKind
- type FileLoc
- type InParam
- type LanguageEnforceLevel
- type Modifiers
- type OutParam
- type Param
- type Params
- type ParseError
- type Pipeline
- type PreprocessError
- type RefExp
- type Resources
- type ReturnStm
- type SrcParam
- type Stage
- type StageCodeType
- type StageLanguage
- type Type
- type UserType
- type ValExp
Constants ¶
const ( KindArray ExpKind = "array" KindMap = "map" KindFloat = "float" KindInt = "int" KindString = "string" KindBool = "bool" KindNull = "null" KindSelf = "self" // reference KindCall = "call" // reference )
const ( INDENT string = " " NEWLINE string = "\n" )
const AS = 57375
const BOOL = 57394
const CALL = 57365
const COLON = 57350
const COMMA = 57351
const COMMENT = 57347
const COMPILED = 57388
const DEFAULT = 57398
const DISABLED = 57371
const DOT = 57383
const EQUALS = 57352
const EXEC = 57387
const FALSE = 57396
const FILETYPE = 57362
const FLOAT = 57392
const GO = 57385
const ID = 57379
const IN = 57372
const INT = 57390
const INVALID = 57348
const LBRACE = 57357
const LBRACKET = 57353
const LITSTRING = 57380
const LOCAL = 57368
const LPAREN = 57355
const MAP = 57389
const MEM_GB = 57377
const NULL = 57397
const NUM_FLOAT = 57381
const NUM_INT = 57382
const OUT = 57373
const PATH = 57393
const PIPELINE = 57364
const PREFLIGHT = 57369
const PREPROCESS_DIRECTIVE = 57399
const PY = 57384
const RBRACE = 57358
const RBRACKET = 57354
const RETURN = 57360
const RPAREN = 57356
const SELF = 57361
const SEMICOLON = 57349
const SH = 57386
const SKIP = 57346
const SPECIAL = 57378
const SPLIT = 57366
const SRC = 57374
const STAGE = 57363
const STRING = 57391
const SWEEP = 57359
const THREADS = 57376
const TRUE = 57395
const USING = 57367
const VOLATILE = 57370
Variables ¶
This section is empty.
Functions ¶
func DefiningFile ¶
func DefiningFile(node AstNodable) string
Gets the name of the file that defines the node.
func JsonDumpAsts ¶
func SearchPipestanceParams ¶
func SetEnforcementLevel ¶
func SetEnforcementLevel(level LanguageEnforceLevel)
Set the global language enforcement level.
Types ¶
type Ast ¶
type Ast struct { UserTypes []*UserType UserTypeTable map[string]*UserType TypeTable map[string]Type Stages []*Stage Pipelines []*Pipeline Callables *Callables Call *CallStm Errors []error // contains filtered or unexported fields }
type AstNodable ¶
type AstNodable interface {
// contains filtered or unexported methods
}
type AstNode ¶
func NewAstNode ¶
type BuiltinType ¶
type BuiltinType struct {
Id string
}
func (*BuiltinType) GetId ¶
func (s *BuiltinType) GetId() string
type Callable ¶
type Callable interface { AstNodable GetId() string GetInParams() *Params GetOutParams() *Params Type() string // contains filtered or unexported methods }
type Dec ¶
type Dec interface { AstNodable // contains filtered or unexported methods }
type Exp ¶
type Exp interface { AstNodable ToInterface() interface{} // contains filtered or unexported methods }
type LanguageEnforceLevel ¶
type LanguageEnforceLevel int
Specifies how strictly new language features should be.
The intent is that when the compiler or runtime become more strict about some existing semantics, in a way which may break older pipelines, the level of backwards compatibility for the compiler and runtime is specified according to these levels. Such backwards compatibility measures should be considered temporary measures - pipelines affected by this flag are depending on deprecated functionality.
const ( // Enforcement of new constraints is disabled. EnforceDisable LanguageEnforceLevel = iota // Violation of new constraints is logged as a warning. EnforceLog // Violation of new constraints triggers an alarm in pipelines. The // result of this is that in addition to logging the warning as it // occurs, the alarm will be printed with the pipeline's final outputs. EnforceAlarm // Backwards compatibility is turned off. Violation of constraints will // cause pipelines to fail. EnforceError )
func GetEnforcementLevel ¶
func GetEnforcementLevel() LanguageEnforceLevel
Get the current language enforcement level.
func ParseEnforcementLevel ¶
func ParseEnforcementLevel(level string) LanguageEnforceLevel
Convert from a string representation.
func (LanguageEnforceLevel) MarshalText ¶
func (self LanguageEnforceLevel) MarshalText() (text []byte, err error)
func (LanguageEnforceLevel) String ¶
func (self LanguageEnforceLevel) String() string
func (*LanguageEnforceLevel) UnmarshalText ¶
func (self *LanguageEnforceLevel) UnmarshalText(text []byte) error
type OutParam ¶
type OutParam struct { Node AstNode Tname string ArrayDim int Id string Help string OutName string Isfile bool }
func (*OutParam) GetArrayDim ¶
func (*OutParam) GetOutName ¶
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError
func (*ParseError) Error ¶
func (self *ParseError) Error() string
type Pipeline ¶
type Pipeline struct { Node AstNode Id string InParams *Params OutParams *Params Calls []*CallStm Callables *Callables `json:"-"` Ret *ReturnStm }
func (*Pipeline) GetInParams ¶
func (*Pipeline) GetOutParams ¶
type PreprocessError ¶
type PreprocessError struct {
// contains filtered or unexported fields
}
PreprocessError
func (*PreprocessError) Error ¶
func (self *PreprocessError) Error() string
type RefExp ¶
func (*RefExp) ToInterface ¶
func (self *RefExp) ToInterface() interface{}
type Stage ¶
type Stage struct { Node AstNode Id string InParams *Params OutParams *Params Src *SrcParam ChunkIns *Params ChunkOuts *Params Split bool Resources *Resources }
func (*Stage) GetInParams ¶
func (*Stage) GetOutParams ¶
type StageCodeType ¶
type StageCodeType int
const ( UnknownStageLang StageCodeType = iota PythonStage ExecStage CompiledStage )
func (StageCodeType) MarshalJSON ¶
func (self StageCodeType) MarshalJSON() ([]byte, error)
func (StageCodeType) String ¶
func (self StageCodeType) String() string
func (*StageCodeType) UnmarshalJSON ¶
func (self *StageCodeType) UnmarshalJSON(b []byte) error
type StageLanguage ¶
type StageLanguage string
func (StageLanguage) Parse ¶
func (lang StageLanguage) Parse() (StageCodeType, error)