fb-doc  0.4.0
FreeBASIC documentation tool
fbdoc_parser.bas File Reference

Source code for the Parser class. More...

#include "fbdoc_options.bi"
#include "fbdoc_version.bi"
Include dependency graph for fbdoc_parser.bas:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SKIP   /* Tk += 3 */
 Snippet to skip to the next token. More...
 
#define SCAN_ML_COMM()
 Find the end of a multi line comment. More...
 
#define SCAN_WORD()
 Find the end of a word. More...
 
#define SETOK(_T_, _A_, _L_)   /* Tok &= MKL(_T_) & MKL(_A_) & MKL(_L_) : ToLast = _T_ */
 snippet to set the current token More...
 
#define EXIT_STOP   /* SETOK(MSG_STOP, Po, 1) : Po -= 1 : EXIT DO */
 snippet to exit in case of end of file More...
 

Detailed Description

Source code for the Parser class.

This file contains the source code for the Parser class. It's used to scan the FB input for relevant constructs and call the matching function in the EmitterIF.

Definition in file fbdoc_parser.bas.

Macro Definition Documentation

#define SKIP   /* Tk += 3 */

Snippet to skip to the next token.

Definition at line 34 of file fbdoc_parser.bas.

#define SCAN_ML_COMM ( )
Value:
/* (multi line FreeBASIC #MACRO)
Po += 2
DO
SELECT CASE AS CONST Buf[Po]
CASE 0 : EXIT DO
CASE ASC(!"\n") : LineNo += 1
CASE ASC("'")
SELECT CASE AS CONST Buf[Po + 1]
CASE 0 : EXIT DO
CASE ASC("/") : Po += 1 : EXIT DO
END SELECT
END SELECT : Po += 1
LOOP
#ENDMACRO */

Find the end of a multi line comment.

This snippet is used to find the end of a multi line comment block. It stops at the characters ' and / (if Buf[Po] isn't ASC("/") then the end of the buffer is reached).

Definition at line 896 of file fbdoc_parser.bas.

#define SCAN_WORD ( )
Value:
/* (multi line FreeBASIC #MACRO)
*A = Po
Po += 1
DO
SELECT CASE AS CONST Buf[Po]
CASE ASC("0") TO ASC("9"), _
ASC("A") TO ASC("Z"), _
ASC("a") TO ASC("z"), ASC("_") : Po += 1
CASE ELSE : EXIT DO
END SELECT
LOOP
#ENDMACRO */

Find the end of a word.

This snippet is used to find the end of a word in the input buffer. Po is at the first non-word character when done.

Definition at line 918 of file fbdoc_parser.bas.

#define SETOK (   _T_,
  _A_,
  _L_ 
)    /* Tok &= MKL(_T_) & MKL(_A_) & MKL(_L_) : ToLast = _T_ */

snippet to set the current token

Definition at line 932 of file fbdoc_parser.bas.

#define EXIT_STOP   /* SETOK(MSG_STOP, Po, 1) : Po -= 1 : EXIT DO */

snippet to exit in case of end of file

Definition at line 935 of file fbdoc_parser.bas.