Browse Source

cmLex.h/.c: Added cmLexFilterFlags() and cmLexSetFilterFlags().

master
kevin 11 years ago
parent
commit
3c807d08c9
2 changed files with 18 additions and 0 deletions
  1. 12
    0
      cmLex.c
  2. 6
    0
      cmLex.h

+ 12
- 0
cmLex.c View File

@@ -637,6 +637,18 @@ cmRC_t             cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcher
637 637
   return _cmLexInstallMatcher( p, id, NULL, NULL, userPtr );
638 638
 }
639 639
 
640
+unsigned           cmLexFilterFlags( cmLexH h )
641
+{
642
+  cmLex* p = _cmLexHandleToPtr(h);
643
+  return p->flags;
644
+}
645
+
646
+void               cmLexSetFilterFlags( cmLexH h, unsigned flags )
647
+{
648
+  cmLex* p = _cmLexHandleToPtr(h);
649
+  p->flags = flags;
650
+}
651
+
640 652
 
641 653
 unsigned           cmLexGetNextToken( cmLexH h )
642 654
 {

+ 6
- 0
cmLex.h View File

@@ -84,6 +84,12 @@ typedef unsigned (*cmLexUserMatcherPtr_t)( const cmChar_t* cp, unsigned cn );
84 84
 
85 85
 cmRC_t             cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcherPtr_t funcPtr );
86 86
 
87
+// Get and set the lexer filter flags kReturnXXXLexFl.
88
+// These flags can be safely enabled and disabled between
89
+// calls to cmLexGetNextToken().
90
+unsigned           cmLexFilterFlags( cmLexH h );
91
+void               cmLexSetFilterFlags( cmLexH h, unsigned flags );
92
+
87 93
 // Return the type id of the current token and advances to the next token
88 94
 unsigned           cmLexGetNextToken( cmLexH h );
89 95
 

Loading…
Cancel
Save