FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
parser-statement.bas
Go to the documentation of this file.
1
'' statements top-level parsing
2
''
3
'' chng: sep/2004 written [v1ctor]
4
5
6
#include once
"
fb.bi
"
7
#include once
"
fbint.bi
"
8
#include once
"
parser.bi
"
9
10
'':::::
11
''Statement = STT_SEPARATOR? ( Declaration
12
'' | ProcCallOrAssign
13
'' | CompoundStmt
14
'' | QuirkStmt
15
'' | AsmBlock
16
'' | AssignmentOrPtrCall )?
17
'' (STT_SEPARATOR Statement)* .
18
''
19
sub
cStatement
()
20
'' ':'?
21
if
(
lexGetToken
( ) = FB_TK_STMTSEP )
then
22
parser.stmt.cnt += 1
23
lexSkipToken
( )
24
end if
25
26
do
27
if
(
cDeclaration
( ) = FALSE )
then
28
if
(
cCompoundStmt
( ) = FALSE )
then
29
if
(
cProcCallOrAssign
( ) = FALSE )
then
30
if
(
cQuirkStmt
( ) = FALSE )
then
31
if
(
cAsmBlock
( ) = FALSE )
then
32
cAssignmentOrPtrCall
( )
33
end if
34
end if
35
end if
36
end if
37
end if
38
39
parser.stmt.cnt += 1
40
41
'' ':'?
42
if
(
lexGetToken
( ) <> FB_TK_STMTSEP )
then
43
exit do
44
end if
45
lexSkipToken
( )
46
loop
47
end sub
48
49
'' StmtSeparator = (':' | EOL | EOF)+ .
50
function
cStmtSeparator
(
byval
lexflags
as
LEXCHECK )
as integer
51
function
= FALSE
52
53
do
54
select case
lexGetToken
( lexflags )
55
case
FB_TK_STMTSEP, FB_TK_EOL
56
parser.stmt.cnt += 1
57
lexSkipToken
( lexflags )
58
function
= TRUE
59
60
case
FB_TK_EOF
61
function
= TRUE
62
exit do
63
64
case else
65
exit do
66
end select
67
loop
68
end function
69
compiler
parser-statement.bas
Generated on Thu Jan 23 2014 19:39:50 for FreeBASIC by
1.8.4