module
Version:
v0.0.0-...-7323597
Opens a new window with list of versions in this module.
Published: Nov 6, 2017
License: MIT
Opens a new window with license information.
README
¶
Parser
package main
import "github.com/byte-mug/semiparse/scanlist"
import "github.com/byte-mug/semiparse/parser"
import "github.com/byte-mug/semiparse/cparse"
import "github.com/byte-mug/semiparse/ecparse"
import "strings"
import "fmt"
//import "text/scanner"
const src = `
//object.getX:int(arg);
i[].Array;
//a = b + c;
`
func buildParser() *parser.Parser {
p := new(parser.Parser).Construct()
cparse.RegisterExpr(p)
cparse.RegisterType(p)
cparse.RegisterExprCast(p)
ecparse.RegisterExprOCX(p)
return p
}
func main() {
s := new(scanlist.BaseScanner)
s.Init(strings.NewReader(src))
s.Dict = cparse.CKeywords
l := s.Next()
p := buildParser()
res := p.Match("Expr",l)
fmt.Println(res.Result)
fmt.Println(res.Data)
}
Directories
¶
A set of parser rules for C-Like syntax.
|
A set of parser rules for C-Like syntax. |
Extensions to the C-like parser.
|
Extensions to the C-like parser. |
A Parser library and framework.
|
A Parser library and framework. |
A Lazy-Evaluating Linked list around the "text/scanner" package.
|
A Lazy-Evaluating Linked list around the "text/scanner" package. |
Click to show internal directories.
Click to hide internal directories.