Exemple #1
0
    def __init__(self, *args):
        super().__init__(*args)
        self.from_ = self.options.pop("from", None)
        if (self.from_ is not None):
            try:
                self.from_ = int(self.from_)
            except ValueError:
                pass
        if (ch.tree_child(self.tree, "copy_shell") is not None):
            paths = [
                variables_sub(i,
                              env.env_build) for i in ch.tree_child_terminals(
                                  self.tree, "copy_shell", "WORD")
            ]
        elif (ch.tree_child(self.tree, "copy_list") is not None):
            paths = [
                variables_sub(i,
                              env.env_build) for i in ch.tree_child_terminals(
                                  self.tree, "copy_list", "STRING_QUOTED")
            ]
            for i in range(len(paths)):
                paths[i] = paths[i][1:-1]  #strip quotes
        else:
            assert False, "unreachable code reached"

        self.srcs = paths[:-1]
        self.dst = paths[-1]
Exemple #2
0
 def __init__(self, *args):
    super().__init__(*args)
    self.from_ = self.options.pop("from", None)
    if (self.from_ is not None):
       try:
          self.from_ = int(self.from_)
       except ValueError:
          pass
    if (ch.tree_child(self.tree, "copy_shell") is not None):
       paths = [variables_sub(i, env.env_build)
                for i in ch.tree_child_terminals(self.tree, "copy_shell",
                                                 "WORD")]
       self.srcs = paths[:-1]
       self.dst = paths[-1]
    else:
       assert (ch.tree_child(self.tree, "copy_list") is not None)
       self.unsupported_yet_fatal("list form", 784)
Exemple #3
0
 def __init__(self, *args):
    super().__init__(*args)
    self.base_ref = ch.Image_Ref(ch.tree_child(self.tree, "image_ref"))
    self.alias = ch.tree_child_terminal(self.tree, "from_alias",
                                        "IR_PATH_COMPONENT")