Example #1
0
    def stormcmdargs(self, kids):
        kids = self._convert_children(kids)
        argv = []

        for kid in kids:
            if isinstance(kid, s_ast.SubQuery):
                argv.append(s_ast.Const(kid.text))
            else:
                argv.append(self._convert_child(kid))

        return s_ast.List(kids=argv)
Example #2
0
    def valu(self):

        self.ignore(whitespace)

        # a simple whitespace separated string
        nexc = self.nextchar()
        if nexc in alphanum or nexc in ('-', '?'):
            text = self.noms(until=mustquote)
            return s_ast.Const(text)

        if self.nextstr('('):
            kids = self.valulist()
            # TODO Value() ctor convention...
            return s_ast.List(None, kids=kids)

        if self.nextstr(':'):
            return self.relpropvalu()

        if self.nextstr('.'):
            return self.univpropvalu()

        if self.nextstr('#'):
            tag = self.tagname()
            return s_ast.TagPropValue(kids=(tag,))

        if self.nextstr('$'):
            return self.varvalu()

        if self.nextstr('"'):
            text = self.quoted()
            return s_ast.Const(text)

        if self.nextstr("'"):
            text = self.singlequoted()
            return s_ast.Const(text)

        self._raiseSyntaxError('unrecognized value prefix')
Example #3
0
    def stormcmdargs(self, kids):
        kids = self._convert_children(kids)

        return s_ast.List(kids=kids)
Example #4
0
 def valulist(self, kids):
     kids = self._convert_children(kids)
     return s_ast.List(kids=kids)