dsl

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: GPL-3.0, GPL-3.0-or-later Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionStatement

type FunctionStatement struct {
	Name string
	Args []string
}

FunctionStatement represents one parsed function

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser represents a parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) ParseFunction

func (p *Parser) ParseFunction() (*FunctionStatement, error)

ParseFunction extract tokens from string ex : test1("arg1","arg2")

func (*Parser) ParsePositionAndFunctions

func (p *Parser) ParsePositionAndFunctions() (*PositionStatement, error)

ParsePositionAndFunctions extract tokens from string ex : position:test|test1("arg1","arg2")

func (*Parser) ParsePositionsAndFunctions

func (p *Parser) ParsePositionsAndFunctions() (*[]PositionStatement, error)

ParsePositionsAndFunctions extract tokens from string ex : position:test,position:test1("arg1","arg2")

type PositionStatement

type PositionStatement struct {
	Position  int
	Functions []FunctionStatement
}

PositionStatement represents all parsed functions from command line

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan extract token from characters

type Token

type Token int

Token represents a entity extracted from string parsing

const (
	ILLEGAL Token = iota
	EOF

	NUMBER
	ALNUM
	STRING
	OPAREN
	CPAREN
	COMMA
	COLON
	DQUOTE
	EDQUOTE
	PIPE
	DOT
)

Jump to

Keyboard shortcuts

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