FreeBASIC  0.91.0
parser-decl-proc.bas
Go to the documentation of this file.
1 '' proc (SUB or FUNCTION) declarations
2 ''
3 '' chng: sep/2004 written [v1ctor]
4 
5 #include once "fb.bi"
6 #include once "fbint.bi"
7 #include once "parser.bi"
8 #include once "ast.bi"
9 
10 '' ProcDecl = DECLARE SUB|FUNCTION|OPERATOR ProcHeader .
11 sub cProcDecl( )
12  dim as integer tk = any
13 
14  if( cCompStmtIsAllowed( FB_CMPSTMT_MASK_DECL ) = FALSE ) then
15  hSkipStmt( )
16  exit sub
17  end if
18 
19  '' DECLARE
20  lexSkipToken( )
21 
22  '' SUB|FUNCTION|OPERATOR
23  tk = lexGetToken( )
24  select case( tk )
25  case FB_TK_SUB, FB_TK_FUNCTION, FB_TK_OPERATOR
26  lexSkipToken( )
27 
28  '' ProcHeader
29  cProcHeader( 0, FALSE, FB_PROCOPT_ISPROTO, tk )
30 
31  case else
32  errReport( FB_ERRMSG_SYNTAXERROR )
33  '' error recovery: skip stmt
34  hSkipStmt( )
35  end select
36 end sub
37