Documentation ¶
Index ¶
- Constants
- Variables
- func ASSOC(i int) int
- func InitFlags(x Flags)
- func Main(filename string)
- func PLEVEL(i int) int
- func SETASC(i, j int) int
- func SETPLEV(i, j int) int
- func SETTYPE(i, j int) int
- func TYPE(i int) int
- type Error
- type Flags
- type Item
- type Lkset
- type Pitem
- type Resrv
- type Row
- type Symb
- type Wset
Constants ¶
View Source
const ( ACTSIZE = 240000 NSTATES = 16000 TEMPSIZE = 16000 SYMINC = 50 // increase for non-term or term RULEINC = 50 // increase for max rule length prodptr[i] PRODINC = 100 // increase for productions prodptr WSETINC = 50 // increase for working sets wsets STATEINC = 200 // increase for states statemem PRIVATE = 0xE000 // unicode private use NTBASE = 010000 ERRCODE = 8190 ACCEPTCODE = 8191 YYLEXUNK = 3 TOKSTART = 4 //index of first defined token )
the following are adjustable according to memory size
View Source
const ( NOASC = iota LASC RASC BASC )
no, left, right, binary assoc.
View Source
const ( DONE = iota MUSTDO MUSTLOOKAHEAD )
flags for state generation
View Source
const ( ACTFLAG = 1 << (iota + 2) REDFLAG )
flags for a rule having an action, and being reduced
View Source
const ( IDENTIFIER = PRIVATE + iota MARK TERM LEFT RIGHT BINARY PREC LCURLY IDENTCOLON NUMBER START TYPEDEF TYPENAME UNION ERROR )
parse tokens
View Source
const EMPTY = 1
View Source
const ENDFILE = 0
View Source
const EOF = -1
View Source
const NOMORE = -1000
View Source
const OK = 1
View Source
const WHOKNOWS = 0
Variables ¶
View Source
var CmdYacc = &cli.Command{ Name: "yacc", Usage: "generates parsers for LALR(1) grammars", ArgsUsage: "<input>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "l", Usage: "disable line directives", }, &cli.StringFlag{ Name: "o", Usage: "set parser output file", Value: "y.wa", }, &cli.StringFlag{ Name: "p", Usage: "name prefix to use in generated code", Value: "yy", }, &cli.StringFlag{ Name: "v", Usage: "create parsing tables", Value: "y.output", }, &cli.StringFlag{ Name: "c", Usage: "set copyright file", Value: "", }, }, Action: func(c *cli.Context) error { if c.NArg() != 1 { cli.ShowSubcommandHelpAndExit(c, 1) } InitFlags(Flags{ Oflag: c.String("o"), Vflag: c.String("v"), Lflag: c.Bool("l"), Prefix: c.String("p"), Copyright: loadCopyright(c.String("c")), }) Main(c.Args().First()) return nil }, }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.