def list(self, _t):    
     value=None
     
     list_AST_in = None
     if _t != antlr.ASTNULL:
         list_AST_in = _t
     e = None
     elements = []
     value = CatList(elements)
     try:      ## for error handling
         if not _t:
             _t = antlr.ASTNULL
         la1 = _t.getType()
         if False:
             pass
         elif la1 and la1 in [LIST]:
             pass
             _t6 = _t
             tmp17_AST_in = _t
             self.match(_t,LIST)
             _t = _t.getFirstChild()
             _cnt8= 0
             while True:
                 if not _t:
                     _t = antlr.ASTNULL
                 if (_tokenSet_0.member(_t.getType())):
                     pass
                     e=self.expr(_t)
                     _t = self._retTree
                     if e:
                        from stringtemplate3.language.ASTExpr import convertAnythingToList
                        e = convertAnythingToList(e)
                        elements.append(e)
                 else:
                     break
                 
                 _cnt8 += 1
             if _cnt8 < 1:
                 raise antlr.NoViableAltException(_t)
             _t = _t6
             _t = _t.getNextSibling()
         elif la1 and la1 in [NOTHING]:
             pass
             tmp18_AST_in = _t
             self.match(_t,NOTHING)
             _t = _t.getNextSibling()
             nullSingleton = [None]
             element.append(nullSingleton)
         else:
                 raise antlr.NoViableAltException(_t)
             
     
     except antlr.RecognitionException, ex:
         self.reportError(ex)
         if _t:
             _t = _t.getNextSibling()
    def __init__(self, lists):
        from stringtemplate3.language.ASTExpr import convertAnythingToList

        self.elements = []
        for attribute in lists:
            self.elements.extend(convertAnythingToList(attribute))