Major overhaul of C/C++ scanner API. Unified tokenizing code so that tokens are scanned by a common code base
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7378cdd2f5
commit
b92d8e5cff
9 changed files with 564 additions and 1170 deletions
|
|
@ -26,7 +26,7 @@ constant expressions.
|
|||
<p>
|
||||
All of these functions are declared in <tt>Source/Swig/swigscan.h</tt>. This API is considered to be stable.
|
||||
|
||||
<h2>Creation and Deletion of Scanner</h2>
|
||||
<h2>Creation and Deletion of Scanners</h2>
|
||||
|
||||
The following functions are used to create and destroy a scanner object. More than one scanner object can be created and used
|
||||
as necessary.
|
||||
|
|
@ -118,17 +118,23 @@ Changes the current filename and line number of the scanner.<
|
|||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b><tt>String *Scanner_get_file(Scanner *s)</tt></b>
|
||||
<b><tt>String *Scanner_file(Scanner *s)</tt></b>
|
||||
<blockquote>
|
||||
Gets the current filename associated with text in the scanner.
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b><tt>int Scanner_get_line(Scanner *s)</tt></b>
|
||||
<b><tt>int Scanner_line(Scanner *s)</tt></b>
|
||||
<blockquote>
|
||||
Gets the current line number associated with text in the scanner.
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b><tt>int Scanner_start_line(Scanner *s)</tt></b>
|
||||
<blockquote>
|
||||
Gets the starting line number of the last token returned by the scanner.
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b><tt>void Scanner_idstart(Scanner *s, char *idchar)</tt></b>
|
||||
<blockquote>
|
||||
|
|
@ -159,6 +165,13 @@ A convenience function that returns 0 or 1 depending on whether <tt>tokval</tt>
|
|||
operator overloading).
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b><tt>void Scanner_freeze_line(int val)</tt></b>
|
||||
<blockquote>
|
||||
Freezes the current line number depending upon whether or not <tt>val</tt> is 1 or 0. When the line number is frozen, newline characters will not result in
|
||||
updates to the line number. This is sometimes useful in tracking line numbers through complicated macro expansions.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<h2>Token Codes</h2>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue