package muesli import ( _ "bytes" _ "errors" _ "fmt" _ "io" _ "reflect" _ "runtime" _ "strings" _ "unicode" _ "io" _ "os" _ "bufio" _ "unicode" // "gitlab.com/beoran/woe/graphviz" // _ "gitlab.com/beoran/woe/monolog" "gitlab.com/beoran/gdast/tree" ) type AstKind int const ( AstKindProgram = AstKind(iota) AstKindStatements AstKindStatement AstKindCommand AstKindArguments AstKindBlock AstKindList AstKindCapture AstKindWordValue AstKindWord AstKindType AstKindValue AstKindEox AstKindError ) /* Run time values */ type Value interface { } type IntValue int64 type FloatValue float64 type StringValue string type BoolValue bool type WordValue string type TypeValue string type AnyValue struct { } type ListValue struct { List []Value } type Token struct { TokenKind Value Position } /* AST node kind */ type Ast struct { tree.Node AstKind * Token } type Parser struct { Lexer Ast } func (parser * Parser) ParseProgram() error { /* for parser.Position < len(Input) { } */ return nil } func (parser * Parser) Parse() (Ast, error) { parser.Index = 0 err := parser.ParseProgram() return parser.Ast, err }