123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- 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
- }
|