tesseract v5.3.3.20231005
cpp.keywords Namespace Reference

Functions

def IsKeyword (token)
 
def IsBuiltinType (token)
 

Variables

 TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split())
 
 TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split())
 
 ACCESS = set('public protected private friend'.split())
 
 CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split())
 
 OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split())
 
 OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split())
 
 CONTROL = set('case switch default if else return goto'.split())
 
 EXCEPTION = set('try catch throw'.split())
 
 LOOP = set('while do for break continue'.split())
 
 ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP
 

Function Documentation

◆ IsBuiltinType()

def cpp.keywords.IsBuiltinType (   token)

Definition at line 52 of file keywords.py.

52def IsBuiltinType(token):
53 if token in ('virtual', 'inline'):
54 # These only apply to methods, they can't be types by themselves.
55 return False
56 return token in TYPES or token in TYPE_MODIFIERS
def IsBuiltinType(token)
Definition: keywords.py:52

◆ IsKeyword()

def cpp.keywords.IsKeyword (   token)

Definition at line 49 of file keywords.py.

49def IsKeyword(token):
50 return token in ALL
51
def IsKeyword(token)
Definition: keywords.py:49

Variable Documentation

◆ ACCESS

cpp.keywords.ACCESS = set('public protected private friend'.split())

Definition at line 35 of file keywords.py.

◆ ALL

cpp.keywords.ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP

Definition at line 46 of file keywords.py.

◆ CASTS

cpp.keywords.CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split())

Definition at line 37 of file keywords.py.

◆ CONTROL

cpp.keywords.CONTROL = set('case switch default if else return goto'.split())

Definition at line 42 of file keywords.py.

◆ EXCEPTION

cpp.keywords.EXCEPTION = set('try catch throw'.split())

Definition at line 43 of file keywords.py.

◆ LOOP

cpp.keywords.LOOP = set('while do for break continue'.split())

Definition at line 44 of file keywords.py.

◆ OTHER_TYPES

cpp.keywords.OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split())

Definition at line 40 of file keywords.py.

◆ OTHERS

cpp.keywords.OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split())

Definition at line 39 of file keywords.py.

◆ TYPE_MODIFIERS

cpp.keywords.TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split())

Definition at line 34 of file keywords.py.

◆ TYPES

cpp.keywords.TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split())

Definition at line 33 of file keywords.py.