The present invention provides a method and apparatus for statement boundary
detection. In one embodiment of the present invention, a parser determines a natural
end of a statement, where possible, based upon the context of the input stream
and the syntax of the programming language. Thus, no statement terminator is necessary
when a natural end to a statement is determined. The parser uses the natural end
of a statement to terminate one statement and begin parsing another statement.
In one embodiment, a special statement termination token is required to terminate
a statement when no natural statement end exists. In another embodiment, a special
statement termination token can be used to terminate a statement when a natural
end of the statement exists.