2 GTSAM Copyright 2010-2020, Georgia Tech Research Corporation, 
    3 Atlanta, Georgia 30332-0415 
    6 See LICENSE for the license information 
    8 Classes and rules for declarations such as includes and forward declarations. 
   10 Author: Duy Nguyen Ta, Fan Jiang, Matthew Sklar, Varun Agrawal, and Frank Dellaert 
   13 from pyparsing 
import CharsNotIn, Optional  
 
   15 from .tokens 
import (CLASS, COLON, INCLUDE, LOPBRACK, ROPBRACK, SEMI_COLON,
 
   17 from .type 
import Typename
 
   18 from .utils 
import collect_namespaces
 
   23     Rule to parse #include directives. 
   25     rule = (INCLUDE + LOPBRACK + CharsNotIn(
'>')(
"header") +
 
   26             ROPBRACK).setParseAction(
lambda t: 
Include(t.header))
 
   28     def __init__(self, header: CharsNotIn, parent: str = 
''):
 
   38     Rule to parse forward declarations in the interface file. 
   40     rule = (Optional(
VIRTUAL(
"is_virtual")) + CLASS + Typename.rule(
"name") +
 
   41             Optional(COLON + Typename.rule(
"parent_type")) +
 
   43                 t.name, t.parent_type, t.is_virtual))
 
   50         self.
name = typename.name
 
   61         """Get the namespaces which this class is nested under as a list."""