示例#1
0
文件: parser.go 项目: yingmsky/e8vm
func newParser(f string, r io.Reader) (*parser, *lex8.Recorder) {
	ret := new(parser)

	var x lex8.Tokener = newLexer(f, r)
	x = newSemiInserter(x)
	rec := lex8.NewRecorder(x)
	ret.x = lex8.NewCommentRemover(rec)
	ret.Parser = lex8.NewParser(ret.x, Types)
	return ret, rec
}
示例#2
0
文件: parser.go 项目: yingmsky/e8vm
func makeTokener(f string, r io.Reader) (lex8.Tokener, *lex8.Recorder) {
	var x lex8.Tokener = newLexer(f, r)
	x = newSemiInserter(x)
	rec := lex8.NewRecorder(x)
	return lex8.NewCommentRemover(rec), rec
}