init
This commit is contained in:
51
vendor/github.com/awalterschulze/gographviz/internal/parser/action.go
generated
vendored
Normal file
51
vendor/github.com/awalterschulze/gographviz/internal/parser/action.go
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// Code generated by gocc; DO NOT EDIT.
|
||||
|
||||
package parser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type action interface {
|
||||
act()
|
||||
String() string
|
||||
}
|
||||
|
||||
type (
|
||||
accept bool
|
||||
shift int // value is next state index
|
||||
reduce int // value is production index
|
||||
)
|
||||
|
||||
func (this accept) act() {}
|
||||
func (this shift) act() {}
|
||||
func (this reduce) act() {}
|
||||
|
||||
func (this accept) Equal(that action) bool {
|
||||
if _, ok := that.(accept); ok {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (this reduce) Equal(that action) bool {
|
||||
that1, ok := that.(reduce)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
return this == that1
|
||||
}
|
||||
|
||||
func (this shift) Equal(that action) bool {
|
||||
that1, ok := that.(shift)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
return this == that1
|
||||
}
|
||||
|
||||
func (this accept) String() string { return "accept(0)" }
|
||||
func (this shift) String() string { return fmt.Sprintf("shift:%d", this) }
|
||||
func (this reduce) String() string {
|
||||
return fmt.Sprintf("reduce:%d(%s)", this, productionsTable[this].String)
|
||||
}
|
152
vendor/github.com/awalterschulze/gographviz/internal/parser/actiontable.go
generated
vendored
Normal file
152
vendor/github.com/awalterschulze/gographviz/internal/parser/actiontable.go
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
// Code generated by gocc; DO NOT EDIT.
|
||||
|
||||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/gob"
|
||||
)
|
||||
|
||||
type (
|
||||
actionTable [numStates]actionRow
|
||||
actionRow struct {
|
||||
canRecover bool
|
||||
actions [numSymbols]action
|
||||
}
|
||||
)
|
||||
|
||||
var actionTab = actionTable{}
|
||||
|
||||
func init() {
|
||||
tab := []struct {
|
||||
CanRecover bool
|
||||
Actions []struct {
|
||||
Index int
|
||||
Action int
|
||||
Amount int
|
||||
}
|
||||
}{}
|
||||
data := []byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9c, 0x97, 0x4f, 0x88, 0x5b, 0x55,
|
||||
0x1b, 0xc6, 0xcf, 0x7b, 0xe7, 0x7e, 0xd3, 0xf9, 0x66, 0xa6, 0xa5, 0x0c, 0xf3, 0x85, 0x61, 0x18,
|
||||
0x86, 0x10, 0xc2, 0x10, 0x42, 0x08, 0x21, 0x0c, 0x21, 0xe4, 0x8b, 0x21, 0x8e, 0x65, 0xd0, 0x21,
|
||||
0x84, 0x10, 0x42, 0x08, 0x31, 0x86, 0x9a, 0xa6, 0x21, 0x0d, 0xf1, 0x36, 0x4c, 0xd3, 0xa1, 0xe0,
|
||||
0x1f, 0x6a, 0xad, 0xda, 0x95, 0xb8, 0x70, 0xe1, 0xca, 0xa5, 0x0b, 0x17, 0x22, 0xe2, 0x42, 0x5c,
|
||||
0x88, 0x0b, 0xe9, 0x42, 0x5c, 0xba, 0x10, 0x17, 0x22, 0x2e, 0x5c, 0x89, 0xb8, 0x10, 0x11, 0x17,
|
||||
0xbd, 0x72, 0xcf, 0x2f, 0x3d, 0x99, 0xd4, 0xc9, 0xe4, 0x26, 0x74, 0x71, 0x6e, 0x4e, 0xef, 0xf3,
|
||||
0x7b, 0x9e, 0x73, 0xce, 0x7b, 0xce, 0x3d, 0x73, 0xd1, 0x7d, 0xdb, 0x12, 0xcb, 0x7d, 0xa0, 0xc4,
|
||||
0xbd, 0xa7, 0x54, 0xc4, 0x7d, 0x7d, 0x49, 0x2c, 0xf7, 0x9e, 0x12, 0x4b, 0x56, 0x9f, 0x79, 0xd1,
|
||||
0x29, 0x5f, 0xbf, 0x76, 0xf3, 0xe4, 0xfa, 0x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e0, 0xcc, 0x69, 0x6b, 0xaf, 0x23, 0x77, 0xbe, 0xd3, 0x81, 0x2f, 0xa7, 0x43,
|
||||
0xfd, 0x14, 0x10, 0x5b, 0x8e, 0x94, 0xb2, 0x96, 0x9f, 0xe0, 0xcc, 0x00, 0x58, 0xde, 0x3f, 0xa5,
|
||||
0xac, 0x8b, 0x62, 0x8b, 0x25, 0x57, 0x95, 0x4e, 0x7c, 0xd5, 0xb3, 0xd7, 0xcd, 0x25, 0x9a, 0xcb,
|
||||
0x62, 0x4b, 0xd1, 0x63, 0xe9, 0x5f, 0x9b, 0x34, 0x01, 0x9a, 0x1d, 0xb1, 0xa5, 0xec, 0x91, 0xf5,
|
||||
0xaf, 0x20, 0x4d, 0x88, 0x26, 0xac, 0x9b, 0xb3, 0x07, 0x57, 0x99, 0x91, 0xed, 0x82, 0x4e, 0x14,
|
||||
0x22, 0x51, 0x88, 0x44, 0x21, 0x32, 0x84, 0xc8, 0x10, 0xc2, 0x35, 0x84, 0x4f, 0x48, 0x29, 0x6b,
|
||||
0x45, 0x6b, 0xf6, 0xd0, 0xec, 0xa1, 0xd9, 0xf3, 0x46, 0x61, 0x4b, 0x0d, 0xe9, 0x1e, 0xd2, 0x3d,
|
||||
0xa4, 0x7b, 0x48, 0xf7, 0x8c, 0x34, 0x86, 0x34, 0x86, 0x34, 0xc6, 0x04, 0xc4, 0x90, 0xc6, 0x90,
|
||||
0xc6, 0x90, 0xc6, 0x90, 0xc6, 0x8c, 0x34, 0x8e, 0x34, 0x8e, 0x34, 0x8e, 0x34, 0x8e, 0x34, 0x8e,
|
||||
0x34, 0x8e, 0x34, 0x8e, 0x34, 0x6e, 0xa4, 0x09, 0xa4, 0x09, 0xa4, 0x09, 0xa4, 0x09, 0xa4, 0x09,
|
||||
0xa4, 0x09, 0xa4, 0x09, 0xa4, 0x09, 0xa5, 0xac, 0x55, 0x2d, 0x4d, 0x22, 0x4d, 0x22, 0x4d, 0x22,
|
||||
0x4d, 0x22, 0x4d, 0x22, 0x4d, 0x22, 0x4d, 0x7a, 0x8b, 0x63, 0x4b, 0xd3, 0x5b, 0x1c, 0xfb, 0xf1,
|
||||
0xe2, 0x24, 0x27, 0x6a, 0x67, 0xfc, 0xb4, 0xa6, 0xe1, 0x0d, 0xe0, 0x0d, 0xe0, 0x0d, 0xe0, 0x0d,
|
||||
0xe0, 0x0d, 0xe0, 0x0d, 0x35, 0xd2, 0x68, 0x8f, 0xc6, 0x59, 0x1e, 0x0d, 0x53, 0xee, 0xbd, 0x71,
|
||||
0xb9, 0x53, 0x6f, 0x27, 0x6a, 0xb4, 0x43, 0xb4, 0xc1, 0x09, 0x06, 0x27, 0x5e, 0xbd, 0xe9, 0x66,
|
||||
0x83, 0x66, 0x93, 0x26, 0x40, 0xb3, 0x43, 0xb3, 0x4b, 0x13, 0xa4, 0x09, 0xd1, 0x84, 0x47, 0xdb,
|
||||
0xed, 0xac, 0x7a, 0x73, 0x7c, 0xd4, 0xdb, 0x93, 0x9a, 0x63, 0x5f, 0x1b, 0x70, 0x9a, 0xe3, 0x1d,
|
||||
0x5f, 0xea, 0x57, 0xcc, 0x3e, 0xdc, 0x98, 0xc2, 0x79, 0x6d, 0x81, 0xe4, 0xee, 0xdd, 0x19, 0xa2,
|
||||
0xff, 0xea, 0x05, 0xd8, 0x67, 0x01, 0xf6, 0x59, 0x80, 0x7d, 0x16, 0x60, 0x9f, 0x99, 0xdf, 0x67,
|
||||
0xe6, 0xf7, 0x59, 0x61, 0xef, 0x28, 0xde, 0xe5, 0x67, 0x58, 0x37, 0xde, 0xa2, 0x6e, 0x79, 0xff,
|
||||
0xf1, 0x00, 0xa8, 0xfb, 0xce, 0xb4, 0x28, 0xef, 0xce, 0x9c, 0x07, 0xad, 0x7f, 0xcf, 0xd4, 0x5d,
|
||||
0x8b, 0x54, 0x2d, 0x52, 0xb5, 0x48, 0xd5, 0x22, 0x55, 0x8b, 0x54, 0x2d, 0xea, 0xa1, 0x45, 0xa8,
|
||||
0x16, 0x85, 0xd0, 0xa2, 0x10, 0x5a, 0x44, 0x6c, 0x8d, 0xd1, 0xef, 0x9b, 0x39, 0x5e, 0x35, 0x27,
|
||||
0x4b, 0x18, 0x93, 0x30, 0x26, 0x61, 0xe8, 0x61, 0xe8, 0x61, 0xb0, 0x61, 0x40, 0x61, 0xa3, 0x89,
|
||||
0xa0, 0x89, 0xa0, 0x89, 0xa0, 0x89, 0xa0, 0x89, 0xa0, 0x89, 0xa0, 0x89, 0x98, 0xc1, 0x94, 0xd0,
|
||||
0x94, 0xd0, 0x94, 0x18, 0x4c, 0x09, 0x69, 0x09, 0x69, 0x69, 0x62, 0x13, 0x95, 0xce, 0xda, 0x44,
|
||||
0x25, 0xa5, 0xac, 0x25, 0x3d, 0xab, 0xee, 0x07, 0x4c, 0xa0, 0xfb, 0xa1, 0x1a, 0x0f, 0x6e, 0x49,
|
||||
0x7b, 0x1c, 0x03, 0x38, 0x46, 0x72, 0x6c, 0xfa, 0x87, 0xf4, 0x0f, 0xe9, 0x1f, 0x9a, 0xd5, 0x4f,
|
||||
0x11, 0x2d, 0x45, 0xb4, 0x14, 0xd1, 0x52, 0x44, 0x4b, 0x11, 0x2d, 0x35, 0xb9, 0xfa, 0x29, 0x10,
|
||||
0xe3, 0x02, 0x4a, 0x83, 0x48, 0x83, 0x48, 0x83, 0x48, 0x83, 0x48, 0x83, 0x48, 0x4f, 0x22, 0xd2,
|
||||
0x20, 0xd2, 0x06, 0xd1, 0x04, 0xd1, 0x04, 0xd1, 0x04, 0xd1, 0x04, 0xd1, 0x04, 0xd1, 0x9c, 0x44,
|
||||
0x34, 0x41, 0x34, 0xcd, 0x1c, 0x17, 0x40, 0x14, 0x40, 0x14, 0x40, 0x14, 0x40, 0x14, 0x40, 0x14,
|
||||
0x26, 0xe6, 0xb8, 0x70, 0xd6, 0x1c, 0x17, 0xa6, 0x15, 0xf0, 0x47, 0xbe, 0x36, 0xb2, 0xfb, 0xb1,
|
||||
0xa9, 0xb2, 0xe5, 0x69, 0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0x47, 0x5c, 0x26, 0x6b,
|
||||
0x16, 0x00, 0x00,
|
||||
}
|
||||
buf, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
dec := gob.NewDecoder(buf)
|
||||
if err := dec.Decode(&tab); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for i, row := range tab {
|
||||
actionTab[i].canRecover = row.CanRecover
|
||||
for _, a := range row.Actions {
|
||||
switch a.Action {
|
||||
case 0:
|
||||
actionTab[i].actions[a.Index] = accept(true)
|
||||
case 1:
|
||||
actionTab[i].actions[a.Index] = reduce(a.Amount)
|
||||
case 2:
|
||||
actionTab[i].actions[a.Index] = shift(a.Amount)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
56
vendor/github.com/awalterschulze/gographviz/internal/parser/gototable.go
generated
vendored
Normal file
56
vendor/github.com/awalterschulze/gographviz/internal/parser/gototable.go
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
// Code generated by gocc; DO NOT EDIT.
|
||||
|
||||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/gob"
|
||||
)
|
||||
|
||||
const numNTSymbols = 17
|
||||
|
||||
type (
|
||||
gotoTable [numStates]gotoRow
|
||||
gotoRow [numNTSymbols]int
|
||||
)
|
||||
|
||||
var gotoTab = gotoTable{}
|
||||
|
||||
func init() {
|
||||
tab := [][]int{}
|
||||
data := []byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe2, 0xfd, 0xdf, 0xcd, 0xc4, 0xc8,
|
||||
0xf4, 0xbf, 0x87, 0x81, 0xf1, 0x7f, 0x17, 0x03, 0x03, 0xcf, 0xff, 0x4e, 0x10, 0xaf, 0x8b, 0x81,
|
||||
0x91, 0x85, 0x81, 0xe1, 0x1f, 0xa7, 0xc6, 0xff, 0x1e, 0x86, 0xff, 0x0d, 0x82, 0x8c, 0x4c, 0x8c,
|
||||
0xa8, 0x40, 0x90, 0x11, 0x1d, 0x60, 0x88, 0xf0, 0x10, 0xa1, 0x46, 0x4c, 0x90, 0x91, 0x51, 0x41,
|
||||
0x49, 0x45, 0x8b, 0x91, 0x91, 0x51, 0x83, 0x51, 0xcd, 0x88, 0x51, 0x87, 0x51, 0x8e, 0x08, 0x5d,
|
||||
0x98, 0x22, 0x36, 0x18, 0x22, 0x0e, 0x82, 0x8c, 0x8c, 0x2e, 0x44, 0x9a, 0xec, 0x81, 0x22, 0xe2,
|
||||
0x43, 0x9a, 0x7b, 0x02, 0xa0, 0x22, 0x61, 0x94, 0xfb, 0x82, 0x54, 0x91, 0x28, 0x10, 0x11, 0x03,
|
||||
0x13, 0x49, 0xc2, 0x50, 0x93, 0x82, 0x21, 0x92, 0xc6, 0xc8, 0xc8, 0x98, 0x81, 0xa2, 0x0b, 0x01,
|
||||
0x72, 0xb0, 0xda, 0x55, 0x80, 0x11, 0x1a, 0x25, 0x44, 0x84, 0x4f, 0x15, 0x79, 0x71, 0x8a, 0x11,
|
||||
0x86, 0xff, 0x9b, 0x88, 0x35, 0xe8, 0x7f, 0xd7, 0xff, 0x1e, 0x18, 0xb3, 0x8d, 0x88, 0xf8, 0xf8,
|
||||
0x3f, 0x89, 0x08, 0x47, 0xfd, 0x9f, 0x46, 0x51, 0x1c, 0xfd, 0x9f, 0x05, 0x37, 0x68, 0x0e, 0xaa,
|
||||
0xaa, 0xff, 0x4b, 0x18, 0xff, 0x2f, 0x62, 0xfc, 0xbf, 0x80, 0xe6, 0xc9, 0xe4, 0xff, 0x0a, 0x54,
|
||||
0x27, 0xfc, 0x5f, 0x43, 0xa5, 0x98, 0x21, 0x46, 0xcd, 0xff, 0x6d, 0xc4, 0x58, 0x86, 0xa9, 0x6d,
|
||||
0x0f, 0x35, 0xdd, 0xf8, 0xff, 0x10, 0x5a, 0xc2, 0x20, 0x32, 0xe4, 0x18, 0x19, 0xff, 0x9f, 0x20,
|
||||
0x4f, 0x1f, 0xbd, 0x45, 0xfe, 0x5f, 0x60, 0xfc, 0x7f, 0x0e, 0x92, 0x98, 0xfe, 0x5f, 0xc2, 0x17,
|
||||
0x74, 0x01, 0xe4, 0xda, 0xf7, 0xff, 0x1a, 0xf9, 0x39, 0xf8, 0x0e, 0x15, 0x8a, 0x77, 0x0a, 0x0a,
|
||||
0x58, 0x0a, 0x8a, 0x65, 0x7c, 0xf1, 0xff, 0xff, 0x09, 0x69, 0x46, 0xbd, 0xc0, 0x63, 0xd4, 0x2b,
|
||||
0xf2, 0x03, 0xf7, 0xd3, 0xc0, 0x06, 0xee, 0x60, 0x13, 0xc1, 0x0c, 0xa0, 0x3f, 0xf4, 0x0a, 0x20,
|
||||
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xfa, 0xd1, 0x1a, 0x46, 0x09, 0x00, 0x00,
|
||||
}
|
||||
buf, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
dec := gob.NewDecoder(buf)
|
||||
if err := dec.Decode(&tab); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for i := 0; i < numStates; i++ {
|
||||
for j := 0; j < numNTSymbols; j++ {
|
||||
gotoTab[i][j] = tab[i][j]
|
||||
}
|
||||
}
|
||||
}
|
72
vendor/github.com/awalterschulze/gographviz/internal/parser/main.go
generated
vendored
Normal file
72
vendor/github.com/awalterschulze/gographviz/internal/parser/main.go
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
//Copyright 2013 GoGraphviz Authors
|
||||
//
|
||||
//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.
|
||||
|
||||
//A parser for the DOT grammar.
|
||||
package parser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/awalterschulze/gographviz/ast"
|
||||
"github.com/awalterschulze/gographviz/internal/lexer"
|
||||
)
|
||||
|
||||
//Parses a DOT string and outputs the
|
||||
//abstract syntax tree representing the graph.
|
||||
func ParseString(dotString string) (*ast.Graph, error) {
|
||||
return ParseBytes([]byte(dotString))
|
||||
}
|
||||
|
||||
//Parses the bytes representing a DOT string
|
||||
//and outputs the abstract syntax tree representing the graph.
|
||||
func ParseBytes(dotBytes []byte) (*ast.Graph, error) {
|
||||
lex := lexer.NewLexer(dotBytes)
|
||||
parser := NewParser()
|
||||
st, err := parser.Parse(lex)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
g, ok := st.(*ast.Graph)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("Parser did not return an *ast.Graph, but rather a %T", st))
|
||||
}
|
||||
return g, nil
|
||||
}
|
||||
|
||||
//Parses a reader which contains a DOT string
|
||||
//and outputs the abstract syntax tree representing the graph.
|
||||
func Parse(r io.Reader) (*ast.Graph, error) {
|
||||
bytes, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseBytes(bytes)
|
||||
}
|
||||
|
||||
//Parses a file which contains a DOT string
|
||||
//and outputs the abstract syntax tree representing the graph.
|
||||
func ParseFile(filename string) (*ast.Graph, error) {
|
||||
f, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
g, err := Parse(f)
|
||||
if err := f.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return g, err
|
||||
}
|
216
vendor/github.com/awalterschulze/gographviz/internal/parser/parser.go
generated
vendored
Normal file
216
vendor/github.com/awalterschulze/gographviz/internal/parser/parser.go
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
// Code generated by gocc; DO NOT EDIT.
|
||||
|
||||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
parseError "github.com/awalterschulze/gographviz/internal/errors"
|
||||
"github.com/awalterschulze/gographviz/internal/token"
|
||||
)
|
||||
|
||||
const (
|
||||
numProductions = 60
|
||||
numStates = 128
|
||||
numSymbols = 36
|
||||
)
|
||||
|
||||
// Stack
|
||||
|
||||
type stack struct {
|
||||
state []int
|
||||
attrib []Attrib
|
||||
}
|
||||
|
||||
const iNITIAL_STACK_SIZE = 100
|
||||
|
||||
func newStack() *stack {
|
||||
return &stack{
|
||||
state: make([]int, 0, iNITIAL_STACK_SIZE),
|
||||
attrib: make([]Attrib, 0, iNITIAL_STACK_SIZE),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *stack) reset() {
|
||||
s.state = s.state[:0]
|
||||
s.attrib = s.attrib[:0]
|
||||
}
|
||||
|
||||
func (s *stack) push(state int, a Attrib) {
|
||||
s.state = append(s.state, state)
|
||||
s.attrib = append(s.attrib, a)
|
||||
}
|
||||
|
||||
func (s *stack) top() int {
|
||||
return s.state[len(s.state)-1]
|
||||
}
|
||||
|
||||
func (s *stack) peek(pos int) int {
|
||||
return s.state[pos]
|
||||
}
|
||||
|
||||
func (s *stack) topIndex() int {
|
||||
return len(s.state) - 1
|
||||
}
|
||||
|
||||
func (s *stack) popN(items int) []Attrib {
|
||||
lo, hi := len(s.state)-items, len(s.state)
|
||||
|
||||
attrib := s.attrib[lo:hi]
|
||||
|
||||
s.state = s.state[:lo]
|
||||
s.attrib = s.attrib[:lo]
|
||||
|
||||
return attrib
|
||||
}
|
||||
|
||||
func (s *stack) String() string {
|
||||
w := new(bytes.Buffer)
|
||||
fmt.Fprintf(w, "stack:\n")
|
||||
for i, st := range s.state {
|
||||
fmt.Fprintf(w, "\t%d: %d , ", i, st)
|
||||
if s.attrib[i] == nil {
|
||||
fmt.Fprintf(w, "nil")
|
||||
} else {
|
||||
switch attr := s.attrib[i].(type) {
|
||||
case *token.Token:
|
||||
fmt.Fprintf(w, "%s", attr.Lit)
|
||||
default:
|
||||
fmt.Fprintf(w, "%v", attr)
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(w, "\n")
|
||||
}
|
||||
return w.String()
|
||||
}
|
||||
|
||||
// Parser
|
||||
|
||||
type Parser struct {
|
||||
stack *stack
|
||||
nextToken *token.Token
|
||||
pos int
|
||||
}
|
||||
|
||||
type Scanner interface {
|
||||
Scan() (tok *token.Token)
|
||||
}
|
||||
|
||||
func NewParser() *Parser {
|
||||
p := &Parser{stack: newStack()}
|
||||
p.Reset()
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Parser) Reset() {
|
||||
p.stack.reset()
|
||||
p.stack.push(0, nil)
|
||||
}
|
||||
|
||||
func (p *Parser) Error(err error, scanner Scanner) (recovered bool, errorAttrib *parseError.Error) {
|
||||
errorAttrib = &parseError.Error{
|
||||
Err: err,
|
||||
ErrorToken: p.nextToken,
|
||||
ErrorSymbols: p.popNonRecoveryStates(),
|
||||
ExpectedTokens: make([]string, 0, 8),
|
||||
}
|
||||
for t, action := range actionTab[p.stack.top()].actions {
|
||||
if action != nil {
|
||||
errorAttrib.ExpectedTokens = append(errorAttrib.ExpectedTokens, token.TokMap.Id(token.Type(t)))
|
||||
}
|
||||
}
|
||||
|
||||
if action := actionTab[p.stack.top()].actions[token.TokMap.Type("error")]; action != nil {
|
||||
p.stack.push(int(action.(shift)), errorAttrib) // action can only be shift
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
if action := actionTab[p.stack.top()].actions[p.nextToken.Type]; action != nil {
|
||||
recovered = true
|
||||
}
|
||||
for !recovered && p.nextToken.Type != token.EOF {
|
||||
p.nextToken = scanner.Scan()
|
||||
if action := actionTab[p.stack.top()].actions[p.nextToken.Type]; action != nil {
|
||||
recovered = true
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (p *Parser) popNonRecoveryStates() (removedAttribs []parseError.ErrorSymbol) {
|
||||
if rs, ok := p.firstRecoveryState(); ok {
|
||||
errorSymbols := p.stack.popN(p.stack.topIndex() - rs)
|
||||
removedAttribs = make([]parseError.ErrorSymbol, len(errorSymbols))
|
||||
for i, e := range errorSymbols {
|
||||
removedAttribs[i] = e
|
||||
}
|
||||
} else {
|
||||
removedAttribs = []parseError.ErrorSymbol{}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// recoveryState points to the highest state on the stack, which can recover
|
||||
func (p *Parser) firstRecoveryState() (recoveryState int, canRecover bool) {
|
||||
recoveryState, canRecover = p.stack.topIndex(), actionTab[p.stack.top()].canRecover
|
||||
for recoveryState > 0 && !canRecover {
|
||||
recoveryState--
|
||||
canRecover = actionTab[p.stack.peek(recoveryState)].canRecover
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (p *Parser) newError(err error) error {
|
||||
e := &parseError.Error{
|
||||
Err: err,
|
||||
StackTop: p.stack.top(),
|
||||
ErrorToken: p.nextToken,
|
||||
}
|
||||
actRow := actionTab[p.stack.top()]
|
||||
for i, t := range actRow.actions {
|
||||
if t != nil {
|
||||
e.ExpectedTokens = append(e.ExpectedTokens, token.TokMap.Id(token.Type(i)))
|
||||
}
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
func (p *Parser) Parse(scanner Scanner) (res interface{}, err error) {
|
||||
p.Reset()
|
||||
p.nextToken = scanner.Scan()
|
||||
for acc := false; !acc; {
|
||||
action := actionTab[p.stack.top()].actions[p.nextToken.Type]
|
||||
if action == nil {
|
||||
if recovered, errAttrib := p.Error(nil, scanner); !recovered {
|
||||
p.nextToken = errAttrib.ErrorToken
|
||||
return nil, p.newError(nil)
|
||||
}
|
||||
if action = actionTab[p.stack.top()].actions[p.nextToken.Type]; action == nil {
|
||||
panic("Error recovery led to invalid action")
|
||||
}
|
||||
}
|
||||
|
||||
switch act := action.(type) {
|
||||
case accept:
|
||||
res = p.stack.popN(1)[0]
|
||||
acc = true
|
||||
case shift:
|
||||
p.stack.push(int(act), p.nextToken)
|
||||
p.nextToken = scanner.Scan()
|
||||
case reduce:
|
||||
prod := productionsTable[int(act)]
|
||||
attrib, err := prod.ReduceFunc(p.stack.popN(prod.NumSymbols))
|
||||
if err != nil {
|
||||
return nil, p.newError(err)
|
||||
} else {
|
||||
p.stack.push(gotoTab[p.stack.top()][prod.NTType], attrib)
|
||||
}
|
||||
default:
|
||||
panic("unknown action: " + action.String())
|
||||
}
|
||||
}
|
||||
return res, nil
|
||||
}
|
623
vendor/github.com/awalterschulze/gographviz/internal/parser/productionstable.go
generated
vendored
Normal file
623
vendor/github.com/awalterschulze/gographviz/internal/parser/productionstable.go
generated
vendored
Normal file
@@ -0,0 +1,623 @@
|
||||
// Code generated by gocc; DO NOT EDIT.
|
||||
|
||||
package parser
|
||||
|
||||
import "github.com/awalterschulze/gographviz/ast"
|
||||
|
||||
type (
|
||||
//TODO: change type and variable names to be consistent with other tables
|
||||
ProdTab [numProductions]ProdTabEntry
|
||||
ProdTabEntry struct {
|
||||
String string
|
||||
Id string
|
||||
NTType int
|
||||
Index int
|
||||
NumSymbols int
|
||||
ReduceFunc func([]Attrib) (Attrib, error)
|
||||
}
|
||||
Attrib interface {
|
||||
}
|
||||
)
|
||||
|
||||
var productionsTable = ProdTab{
|
||||
ProdTabEntry{
|
||||
String: `S' : DotGraph << >>`,
|
||||
Id: "S'",
|
||||
NTType: 0,
|
||||
Index: 0,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : graphx "{" "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, nil, nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 1,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.FALSE, nil, nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict graphx "{" "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, nil, nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 2,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.TRUE, nil, nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : graphx Id "{" "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 3,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict graphx Id "{" "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 4,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : graphx "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, nil, X[2]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 5,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.FALSE, nil, X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : graphx Id "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], X[3]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 6,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], X[3])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict graphx "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, nil, X[3]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 7,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.TRUE, nil, X[3])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict graphx Id "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], X[4]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 8,
|
||||
NumSymbols: 6,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], X[4])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : digraph "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 9,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict digraph "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 10,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : digraph Id "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 11,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict digraph Id "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], nil) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 12,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : digraph "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, X[2]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 13,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : digraph Id "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], X[3]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 14,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], X[3])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict digraph "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, X[3]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 15,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, X[3])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `DotGraph : strict digraph Id "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], X[4]) >>`,
|
||||
Id: "DotGraph",
|
||||
NTType: 1,
|
||||
Index: 16,
|
||||
NumSymbols: 6,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], X[4])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `StmtList : Stmt1 << ast.NewStmtList(X[0]) >>`,
|
||||
Id: "StmtList",
|
||||
NTType: 2,
|
||||
Index: 17,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewStmtList(X[0])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `StmtList : StmtList Stmt1 << ast.AppendStmtList(X[0], X[1]) >>`,
|
||||
Id: "StmtList",
|
||||
NTType: 2,
|
||||
Index: 18,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendStmtList(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt1 : Stmt << X[0], nil >>`,
|
||||
Id: "Stmt1",
|
||||
NTType: 3,
|
||||
Index: 19,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt1 : Stmt ";" << X[0], nil >>`,
|
||||
Id: "Stmt1",
|
||||
NTType: 3,
|
||||
Index: 20,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt : Id "=" Id << ast.NewAttr(X[0], X[2]) >>`,
|
||||
Id: "Stmt",
|
||||
NTType: 4,
|
||||
Index: 21,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAttr(X[0], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt : NodeStmt << X[0], nil >>`,
|
||||
Id: "Stmt",
|
||||
NTType: 4,
|
||||
Index: 22,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt : EdgeStmt << X[0], nil >>`,
|
||||
Id: "Stmt",
|
||||
NTType: 4,
|
||||
Index: 23,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt : AttrStmt << X[0], nil >>`,
|
||||
Id: "Stmt",
|
||||
NTType: 4,
|
||||
Index: 24,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Stmt : SubGraphStmt << X[0], nil >>`,
|
||||
Id: "Stmt",
|
||||
NTType: 4,
|
||||
Index: 25,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return X[0], nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrStmt : graphx AttrList << ast.NewGraphAttrs(X[1]) >>`,
|
||||
Id: "AttrStmt",
|
||||
NTType: 5,
|
||||
Index: 26,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewGraphAttrs(X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrStmt : node AttrList << ast.NewNodeAttrs(X[1]) >>`,
|
||||
Id: "AttrStmt",
|
||||
NTType: 5,
|
||||
Index: 27,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewNodeAttrs(X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrStmt : edge AttrList << ast.NewEdgeAttrs(X[1]) >>`,
|
||||
Id: "AttrStmt",
|
||||
NTType: 5,
|
||||
Index: 28,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeAttrs(X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrList : "[" "]" << ast.NewAttrList(nil) >>`,
|
||||
Id: "AttrList",
|
||||
NTType: 6,
|
||||
Index: 29,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAttrList(nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrList : "[" AList "]" << ast.NewAttrList(X[1]) >>`,
|
||||
Id: "AttrList",
|
||||
NTType: 6,
|
||||
Index: 30,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAttrList(X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrList : AttrList "[" "]" << ast.AppendAttrList(X[0], nil) >>`,
|
||||
Id: "AttrList",
|
||||
NTType: 6,
|
||||
Index: 31,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendAttrList(X[0], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AttrList : AttrList "[" AList "]" << ast.AppendAttrList(X[0], X[2]) >>`,
|
||||
Id: "AttrList",
|
||||
NTType: 6,
|
||||
Index: 32,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendAttrList(X[0], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AList : Attr << ast.NewAList(X[0]) >>`,
|
||||
Id: "AList",
|
||||
NTType: 7,
|
||||
Index: 33,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAList(X[0])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AList : AList Attr << ast.AppendAList(X[0], X[1]) >>`,
|
||||
Id: "AList",
|
||||
NTType: 7,
|
||||
Index: 34,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendAList(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `AList : AList "," Attr << ast.AppendAList(X[0], X[2]) >>`,
|
||||
Id: "AList",
|
||||
NTType: 7,
|
||||
Index: 35,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendAList(X[0], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Attr : Id << ast.NewAttr(X[0], nil) >>`,
|
||||
Id: "Attr",
|
||||
NTType: 8,
|
||||
Index: 36,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAttr(X[0], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Attr : Id "=" Id << ast.NewAttr(X[0], X[2]) >>`,
|
||||
Id: "Attr",
|
||||
NTType: 8,
|
||||
Index: 37,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewAttr(X[0], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeStmt : NodeId EdgeRHS << ast.NewEdgeStmt(X[0], X[1], nil) >>`,
|
||||
Id: "EdgeStmt",
|
||||
NTType: 9,
|
||||
Index: 38,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeStmt(X[0], X[1], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeStmt : NodeId EdgeRHS AttrList << ast.NewEdgeStmt(X[0], X[1], X[2]) >>`,
|
||||
Id: "EdgeStmt",
|
||||
NTType: 9,
|
||||
Index: 39,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeStmt(X[0], X[1], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeStmt : SubGraphStmt EdgeRHS << ast.NewEdgeStmt(X[0], X[1], nil) >>`,
|
||||
Id: "EdgeStmt",
|
||||
NTType: 9,
|
||||
Index: 40,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeStmt(X[0], X[1], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeStmt : SubGraphStmt EdgeRHS AttrList << ast.NewEdgeStmt(X[0], X[1], X[2]) >>`,
|
||||
Id: "EdgeStmt",
|
||||
NTType: 9,
|
||||
Index: 41,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeStmt(X[0], X[1], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeRHS : EdgeOp NodeId << ast.NewEdgeRHS(X[0], X[1]) >>`,
|
||||
Id: "EdgeRHS",
|
||||
NTType: 10,
|
||||
Index: 42,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeRHS(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeRHS : EdgeOp SubGraphStmt << ast.NewEdgeRHS(X[0], X[1]) >>`,
|
||||
Id: "EdgeRHS",
|
||||
NTType: 10,
|
||||
Index: 43,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewEdgeRHS(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeRHS : EdgeRHS EdgeOp NodeId << ast.AppendEdgeRHS(X[0], X[1], X[2]) >>`,
|
||||
Id: "EdgeRHS",
|
||||
NTType: 10,
|
||||
Index: 44,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendEdgeRHS(X[0], X[1], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeRHS : EdgeRHS EdgeOp SubGraphStmt << ast.AppendEdgeRHS(X[0], X[1], X[2]) >>`,
|
||||
Id: "EdgeRHS",
|
||||
NTType: 10,
|
||||
Index: 45,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.AppendEdgeRHS(X[0], X[1], X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `NodeStmt : NodeId << ast.NewNodeStmt(X[0], nil) >>`,
|
||||
Id: "NodeStmt",
|
||||
NTType: 11,
|
||||
Index: 46,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewNodeStmt(X[0], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `NodeStmt : NodeId AttrList << ast.NewNodeStmt(X[0], X[1]) >>`,
|
||||
Id: "NodeStmt",
|
||||
NTType: 11,
|
||||
Index: 47,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewNodeStmt(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `NodeId : Id << ast.NewNodeID(X[0], nil) >>`,
|
||||
Id: "NodeId",
|
||||
NTType: 12,
|
||||
Index: 48,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewNodeID(X[0], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `NodeId : Id Port << ast.NewNodeID(X[0], X[1]) >>`,
|
||||
Id: "NodeId",
|
||||
NTType: 12,
|
||||
Index: 49,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewNodeID(X[0], X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Port : ":" Id << ast.NewPort(X[1], nil), nil >>`,
|
||||
Id: "Port",
|
||||
NTType: 13,
|
||||
Index: 50,
|
||||
NumSymbols: 2,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewPort(X[1], nil), nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Port : ":" Id ":" Id << ast.NewPort(X[1], X[3]), nil >>`,
|
||||
Id: "Port",
|
||||
NTType: 13,
|
||||
Index: 51,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewPort(X[1], X[3]), nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `SubGraphStmt : "{" StmtList "}" << ast.NewSubGraph(nil, X[1]) >>`,
|
||||
Id: "SubGraphStmt",
|
||||
NTType: 14,
|
||||
Index: 52,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewSubGraph(nil, X[1])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `SubGraphStmt : subgraph "{" StmtList "}" << ast.NewSubGraph(nil, X[2]) >>`,
|
||||
Id: "SubGraphStmt",
|
||||
NTType: 14,
|
||||
Index: 53,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewSubGraph(nil, X[2])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `SubGraphStmt : subgraph Id "{" StmtList "}" << ast.NewSubGraph(X[1], X[3]) >>`,
|
||||
Id: "SubGraphStmt",
|
||||
NTType: 14,
|
||||
Index: 54,
|
||||
NumSymbols: 5,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewSubGraph(X[1], X[3])
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `SubGraphStmt : subgraph "{" "}" << ast.NewSubGraph(nil, nil) >>`,
|
||||
Id: "SubGraphStmt",
|
||||
NTType: 14,
|
||||
Index: 55,
|
||||
NumSymbols: 3,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewSubGraph(nil, nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `SubGraphStmt : subgraph Id "{" "}" << ast.NewSubGraph(X[1], nil) >>`,
|
||||
Id: "SubGraphStmt",
|
||||
NTType: 14,
|
||||
Index: 56,
|
||||
NumSymbols: 4,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewSubGraph(X[1], nil)
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeOp : "->" << ast.DIRECTED, nil >>`,
|
||||
Id: "EdgeOp",
|
||||
NTType: 15,
|
||||
Index: 57,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.DIRECTED, nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `EdgeOp : "--" << ast.UNDIRECTED, nil >>`,
|
||||
Id: "EdgeOp",
|
||||
NTType: 15,
|
||||
Index: 58,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.UNDIRECTED, nil
|
||||
},
|
||||
},
|
||||
ProdTabEntry{
|
||||
String: `Id : id << ast.NewID(X[0]) >>`,
|
||||
Id: "Id",
|
||||
NTType: 16,
|
||||
Index: 59,
|
||||
NumSymbols: 1,
|
||||
ReduceFunc: func(X []Attrib) (Attrib, error) {
|
||||
return ast.NewID(X[0])
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user