2 GTSAM Copyright 2010-2020, Georgia Tech Research Corporation,
3 Atlanta, Georgia 30332-0415
6 See LICENSE for the license information
8 Rules and classes for parsing a module.
10 Author: Duy Nguyen Ta, Fan Jiang, Matthew Sklar, Varun Agrawal, and Frank Dellaert
15 from pyparsing
import (ParseResults, ZeroOrMore,
16 cppStyleComment, stringEnd)
18 from .classes
import Class
19 from .declaration
import ForwardDeclaration, Include
20 from .enum
import Enum
21 from .function
import GlobalFunction
22 from .namespace
import Namespace
23 from .template
import TypedefTemplateInstantiation
24 from .variable
import Variable
29 Module is just a global namespace.
40 ZeroOrMore(ForwardDeclaration.rule
43 ^ TypedefTemplateInstantiation.rule
48 ).setParseAction(
lambda t:
Namespace(
'', t.asList())) +
51 rule.ignore(cppStyleComment)
55 """Parse the source string and apply the rules."""
56 return Module.rule.parseString(s)[0]