2 Star 2 Fork 1

cockroachdb/cockroach

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
node.go 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Copied from Go's text/template/parse package and modified for yacc.
// Parse nodes.
package yacc
// Pos represents a byte position in the original input text from which
// this template was parsed.
type Pos int
// Nodes.
// ProductionNode holds is a named production of multiple expressions.
type ProductionNode struct {
Pos
Name string
Expressions []*ExpressionNode
}
func newProduction(pos Pos, name string) *ProductionNode {
return &ProductionNode{Pos: pos, Name: name}
}
// ExpressionNode hold a single expression.
type ExpressionNode struct {
Pos
Items []Item
Command string
}
func newExpression(pos Pos) *ExpressionNode {
return &ExpressionNode{Pos: pos}
}
// Item hold an item.
type Item struct {
Value string
Typ ItemTyp
}
// ItemTyp is the item type.
type ItemTyp int
const (
// TypToken is the token type.
TypToken ItemTyp = iota
// TypLiteral is the literal type.
TypLiteral
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_cockroachdb/cockroach.git
git@gitee.com:mirrors_cockroachdb/cockroach.git
mirrors_cockroachdb
cockroach
cockroach
v1.1.8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385