2 GTSAM Copyright 2010-2020, Georgia Tech Research Corporation,
3 Atlanta, Georgia 30332-0415
6 See LICENSE for the license information
8 All the token definitions.
10 Author: Duy Nguyen Ta, Fan Jiang, Matthew Sklar, Varun Agrawal, and Frank Dellaert
13 from pyparsing
import Or
14 from pyparsing
import (Keyword, Literal, OneOrMore, QuotedString, Suppress,
15 Word, alphanums, alphas, nestedExpr, nums,
16 originalTextFor, printables)
19 IDENT = Word(alphas +
'_', alphanums +
'_') ^ Word(nums)
21 RAW_POINTER, SHARED_POINTER, REF = map(Literal,
"@*&")
23 LPAREN, RPAREN, LBRACE, RBRACE, COLON, SEMI_COLON = map(Suppress,
"(){}:;")
24 LOPBRACK, ROPBRACK, COMMA, EQUAL = map(Suppress,
"<>,=")
25 DUNDER = Suppress(Literal(
"__"))
31 DEFAULT_ARG = originalTextFor(
35 Word(printables, excludeChars=
"(){}[]<>,;") ^
36 nestedExpr(opener=
'(', closer=
')') ^
37 nestedExpr(opener=
'[', closer=
']') ^
38 nestedExpr(opener=
'{', closer=
'}') ^
39 nestedExpr(opener=
'<', closer=
'>')
42 CONST, VIRTUAL, CLASS, STATIC, PAIR, TEMPLATE, TYPEDEF, INCLUDE = map(
55 ENUM = Keyword(
"enum") ^ Keyword(
"enum class") ^ Keyword(
"enum struct")
56 NAMESPACE = Keyword(
"namespace")