%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/doc/re2c/examples/go/
Upload File :
Create Path :
Current File : //usr/share/doc/re2c/examples/go/01_basic.re

//go:generate re2go $INPUT -o $OUTPUT -i
package main

func lex(str string) {
	var cursor int
	/*!re2c
		re2c:define:YYCTYPE = byte;
		re2c:define:YYPEEK = "str[cursor]";
		re2c:define:YYSKIP = "cursor += 1";
		re2c:yyfill:enable = 0;

		number = [1-9][0-9]*;

		number { return }
		*      { panic("error!") }
	*/
}

func main() {
	lex("1234\x00")
}

Zerion Mini Shell 1.0