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, cppStyleComment, stringEnd
17 from .classes
import Class
18 from .declaration
import ForwardDeclaration, Include
19 from .enum
import Enum
20 from .function
import GlobalFunction
21 from .namespace
import Namespace
22 from .template
import TypedefTemplateInstantiation
23 from .variable
import Variable
28 Module is just a global namespace. 39 ZeroOrMore(ForwardDeclaration.rule
42 ^ TypedefTemplateInstantiation.rule
47 ).setParseAction(
lambda t: Namespace(
'', t.asList())) +
50 rule.ignore(cppStyleComment)
54 """Parse the source string and apply the rules.""" 55 return Module.rule.parseString(s)[0]