代码搜索结果
找到约 10,000 项符合
State Machine 的代码
state_sui4.txt
5 1 435 168396703
5 2 435 381260885
5 3 435 1070192441
5 4 435 822513089
5 5 435 45120773
5 6 435 575580597
5 7 435 874802085
5 8 435 606122143
5 9 435 1094276837
5 10 435
lex_state_norule.py
# lex_state2.py
#
# Declaration of a state for which no rules are defined
import sys
sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
comment =
lex_state5.py
# lex_state2.py
#
# Bad state declaration
import sys
sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
comment = 1
states = (('comment', 'exclus
lex_state_try.exp
(NUMBER,'3',1,0)
(PLUS,'+',1,2)
(NUMBER,'4',1,4)
Entering comment state
comment body LexToken(body_part,'This is a comment */',1,9)
(PLUS,'+',1,30)
(NUMBER,'10',1,32)
lex_state1.exp
lex: states must be defined as a tuple or list.
Traceback (most recent call last):
File "./lex_state1.py", line 38, in
lex.lex()
File "../ply/lex.py", line 759, in lex
raise Synta
lex_state2.exp
lex: invalid state specifier 'comment'. Must be a tuple (statename,'exclusive|inclusive')
lex: invalid state specifier 'example'. Must be a tuple (statename,'exclusive|inclusive')
Traceback (most rece
lex_state_noerror.py
# lex_state2.py
#
# Declaration of a state for which no rules are defined
import sys
sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
comment =
lex_state_norule.exp
lex: No rules defined for state 'example'
Traceback (most recent call last):
File "./lex_state_norule.py", line 40, in
lex.lex()
File "../ply/lex.py", line 759, in lex
raise Synta
lex_state5.exp
lex: state 'comment' already defined.
Traceback (most recent call last):
File "./lex_state5.py", line 40, in
lex.lex()
File "../ply/lex.py", line 759, in lex
raise SyntaxError,"le
lex_state3.exp
lex: state name 1 must be a string
lex: No rules defined for state 'example'
Traceback (most recent call last):
File "./lex_state3.py", line 40, in
lex.lex()
File "../ply/lex.py", lin