aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/xsyn.py
blob: 7b2bb582d58ac34a091dd345e60633ef17344680 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import _import_wrapper as iw
import _common as common


class Xsyn(iw.CustomCommand):

    def __init__(self, path, unit):
        self._path = path

    def descr(self):
        return 'XN', self._path, 'yellow'

    def tools(self):
        return []

    def input(self):
        return common.make_tuples([
            '$S/library/cpp/xml/parslib/xsyn2ragel.py', 
            self._path,
            '$S/library/cpp/xml/parslib/xmlpars.xh' 
        ])

    def output(self):
        return common.make_tuples([
            common.tobuilddir(self._path + '.h.rl5')
        ])

    def run(self, extra_args, interpeter):
        self.call(interpeter + [self.resolve_path(common.get(self.input, 0)), self.resolve_path(common.get(self.input, 1)),
                                self.resolve_path(common.get(self.input, 2)), 'dontuse'], stdout=common.get(self.output, 0))


def init():
    iw.addrule('xsyn', Xsyn)