parent
5a6a08e8de
commit
9fb6476a0f
15
genparser.sh
15
genparser.sh
|
@ -1,15 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
echo Running nex...
|
|
||||||
nex query_string.nex
|
|
||||||
grep -v 'panic("unreachable")' query_string.nn.go > query_string.nn.go.new
|
|
||||||
mv query_string.nn.go.new query_string.nn.go
|
|
||||||
echo Running goyacc...
|
|
||||||
go tool yacc -o query_string.y.go query_string.y
|
|
||||||
# remove first line which pollutes godocs
|
|
||||||
tail -n +2 query_string.y.go > query_string.y.go.new
|
|
||||||
mv query_string.y.go.new query_string.y.go
|
|
||||||
# change public Lexer to private lexer
|
|
||||||
sed -i '' -e 's/Lexer/lexer/g' query_string.nn.go
|
|
||||||
sed -i '' -e 's/Newlexer/newLexer/g' query_string.nn.go
|
|
||||||
sed -i '' -e 's/debuglexer/debugLexer/g' query_string.nn.go
|
|
|
@ -6,7 +6,7 @@
|
||||||
/\+/ { logDebugTokens("PLUS"); return tPLUS }
|
/\+/ { logDebugTokens("PLUS"); return tPLUS }
|
||||||
/-/ { logDebugTokens("MINUS"); return tMINUS }
|
/-/ { logDebugTokens("MINUS"); return tMINUS }
|
||||||
/:/ { logDebugTokens("COLON"); return tCOLON }
|
/:/ { logDebugTokens("COLON"); return tCOLON }
|
||||||
/^/ { logDebugTokens("BOOST"); return tBOOST }
|
/\^/ { logDebugTokens("BOOST"); return tBOOST }
|
||||||
/\(/ { logDebugTokens("LPAREN"); return tLPAREN }
|
/\(/ { logDebugTokens("LPAREN"); return tLPAREN }
|
||||||
/\)/ { logDebugTokens("RPAREN"); return tRPAREN }
|
/\)/ { logDebugTokens("RPAREN"); return tRPAREN }
|
||||||
/>/ { logDebugTokens("GREATER"); return tGREATER }
|
/>/ { logDebugTokens("GREATER"); return tGREATER }
|
||||||
|
|
2000
query_string.nn.go
2000
query_string.nn.go
File diff suppressed because it is too large
Load Diff
|
@ -7,6 +7,13 @@
|
||||||
// either express or implied. See the License for the specific language governing permissions
|
// either express or implied. See the License for the specific language governing permissions
|
||||||
// and limitations under the License.
|
// and limitations under the License.
|
||||||
|
|
||||||
|
//go:generate nex query_string.nex
|
||||||
|
//go:generate sed -i "" -e s/Lexer/lexer/g query_string.nn.go
|
||||||
|
//go:generate sed -i "" -e s/Newlexer/newLexer/g query_string.nn.go
|
||||||
|
//go:generate sed -i "" -e s/debuglexer/debugLexer/g query_string.nn.go
|
||||||
|
//go:generate go tool yacc -o query_string.y.go query_string.y
|
||||||
|
//go:generate sed -i "" -e 1d query_string.y.go
|
||||||
|
|
||||||
package bleve
|
package bleve
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user