~manxi-david/pyeffect/pyeffect

« back to all changes in this revision

Viewing changes to s2/__init__.py

  • Committer: dvspeed
  • Date: 2011-12-26 13:18:36 UTC
  • Revision ID: manxi.david@gmail.com-20111226131836-mvoy9y32z0ujxvm1
-Change of folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2011 David Manzanares <manxi.david@gmail.com>
2
 
#This file is part of PyEffect.
3
 
#
4
 
# PyEffect is free software: you can redistribute it and/or modify
5
 
# it under the terms of the GNU General Public License as published by
6
 
# the Free Software Foundation, either version 3 of the License, or
7
 
# (at your option) any later version.
8
 
#
9
 
# PyEffect is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 
# GNU General Public License for more details.
13
 
#
14
 
# You should have received a copy of the GNU General Public License
15
 
# along with PyEffect. If not, see <http://www.gnu.org/licenses/>.
16
 
 
17
 
#This is the PyEffect stage1 compiler
18
 
 
19
 
#Purpose:
20
 
#Transform the source file in format .3p into classes, ...
21
 
 
22
 
import s2
23
 
 
24
 
def comp():
25
 
        s2.comp()
26
 
        """class Func(Line):
27
 
        def __init__(self, l):
28
 
                Line.__init__(self, "func", l)
29
 
                #Path:
30
 
                self.path = []
31
 
                i = 0
32
 
                se = aux.secureQuotes(l)
33
 
                while i < len(l):
34
 
                        if se[i] == "\t":
35
 
                                i = i + 1
36
 
                        else:
37
 
                                break
38
 
                buff = ""
39
 
                while i < len(l):
40
 
                        if se[i] == ".":
41
 
                                self.path.append(buff)
42
 
                                buff = None
43
 
                        elif se[i] == "(":
44
 
                                self.path.append(buff)
45
 
                                break
46
 
                        else:
47
 
                                buff = buff + l[i]
48
 
                        i = i + 1
49
 
                #Args:
50
 
 
51
 
                #self.exp = Exp(exp)
52
 
        def __str__(self):
53
 
                path = ""
54
 
                for a in self.path:
55
 
                        path = path + "->" + a
56
 
                path = path[2:]
57
 
                return Line.__str__(self) + "\nPath: " + path"""