compiler

package
v0.0.0-...-6a20a75 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Copyright 2018 storyicon@foxmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 storyicon@foxmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 storyicon@foxmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 storyicon@foxmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// SignalInvalid identifies unrecognized signals
	SignalInvalid = iota
	// SignalName identifies the beginning of the function name and key name
	SignalName
	// SignalPipeline identifies the beginning of the pipeline
	SignalPipeline
	// SignalObject identifies the beginning of the object
	SignalObject
	// SignalArray identifies the beginning of the array
	SignalArray
)

Variables

This section is empty.

Functions

func Compile

func Compile(expr []byte) (*kernel.Graph, error)

Compile is used to compile expressions

Types

type Iterator

type Iterator struct {
	Error error
	// contains filtered or unexported fields
}

Iterator is a io.Reader like object, with specific read functions.

func ParseBytes

func ParseBytes(bytes []byte) *Iterator

ParseBytes creates an Iterator instance from byte array

func (*Iterator) Read

func (iter *Iterator) Read() (parser *kernel.Graph)

Read attempts to read the parser from the byte stream

func (*Iterator) ReadArray

func (iter *Iterator) ReadArray() (nodes []*kernel.GraphNode)

ReadArray attempts to read a array from the byte stream.

func (*Iterator) ReadChildren

func (iter *Iterator) ReadChildren() (childType int, children []*kernel.GraphNode)

ReadChildren attempts to read node children from the byte stream

func (*Iterator) ReadFuncName

func (iter *Iterator) ReadFuncName() (name string)

ReadFuncName attempts to read function name from the byte stream

func (*Iterator) ReadNode

func (iter *Iterator) ReadNode() (node *kernel.GraphNode)

ReadNode attempts to read a Node from the byte stream.

func (*Iterator) ReadNodeName

func (iter *Iterator) ReadNodeName() (name string)

ReadNodeName attempts to read a continuous node name from the byte stream.

func (*Iterator) ReadObject

func (iter *Iterator) ReadObject() (nodes []*kernel.GraphNode)

ReadObject attempts to read object from the byte stream

func (*Iterator) ReadObjectArray

func (iter *Iterator) ReadObjectArray() (nodes []*kernel.GraphNode)

ReadObjectArray attempts to read a object array from the byte stream.

func (*Iterator) ReadPipeline

func (iter *Iterator) ReadPipeline() *pipeline.Pipeline

ReadPipeline attempts to read pipeline from the byte stream

func (*Iterator) ReadPipelines

func (iter *Iterator) ReadPipelines() (pipelines pipeline.Pipelines)

ReadPipelines attempts to read pipelines from the byte stream

func (*Iterator) ReadStringTuple

func (iter *Iterator) ReadStringTuple() (args []string)

ReadStringTuple attempts to read function arguments from the byte stream

func (*Iterator) ReportError

func (iter *Iterator) ReportError(operation string, msg string)

ReportError record a error in iterator instance with current position.

func (*Iterator) ReportMismatchChar

func (iter *Iterator) ReportMismatchChar(operation string, expect byte, appear byte)

ReportMismatchChar report an error that does not match the expected character.

func (*Iterator) ReportUnExpectedChar

func (iter *Iterator) ReportUnExpectedChar(operation string, appear byte)

ReportUnExpectedChar reports an error of "unexpected character".

func (*Iterator) WhatIsNext

func (iter *Iterator) WhatIsNext() SignalType

WhatIsNext gets ValueType of relatively next element

func (*Iterator) WhatIsNextByte

func (iter *Iterator) WhatIsNextByte() byte

WhatIsNextByte gets byte of relatively next element

type SignalType

type SignalType int

SignalType is the signal value type

Jump to

Keyboard shortcuts

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