Example #1
0
"""Main parsing and conversion routines for translating VB to Python code"""

# << Imports >>
#
# Configuration options
import config

Config = config.VB2PYConfig()

from pprint import pprint as pp
from simpleparse.common import chartypes
import sys, os
import utils

declaration = open(utils.relativePath("vbgrammar.txt"), "r").read()

from simpleparse.parser import Parser

import logger

log = logger.getLogger("VBParser")


# -- end -- << Imports >>
# << Error Classes >>
class VBParserError(Exception):
    """An error occured during parsing"""


class UnhandledStructureError(VBParserError):
    """A structure was parsed but could not be handled by class"""
Example #2
0
 def save(self):
     """Store the options"""
     f = open(utils.relativePath("settings.ini"), "w")
     self._config.write(f)
     f.close()
Example #3
0
"""Main parsing and conversion routines for translating VB to Python code"""

# << Imports >>
#
# Configuration options
import config
Config = config.VB2PYConfig()

from pprint import pprint as pp
from simpleparse.common import chartypes
import sys
import os
import re
import utils

declaration = open(utils.relativePath("vbgrammar.txt"), "r").read()

from simpleparse.parser import Parser

import logger
log = logger.getLogger("VBParser")
# -- end -- << Imports >>
# << Error Classes >>
class VBParserError(Exception): 
    """An error occured during parsing"""

class UnhandledStructureError(VBParserError): 
    """A structure was parsed but could not be handled by class"""
class InvalidOption(VBParserError): 
    """An invalid config option was detected"""
class NestingError(VBParserError): 
Example #4
0
 def __init__(self, appname):
     """Initialize the parser"""
     config.VB2PYConfigObject.__init__(self, filename=utils.relativePath("settings.ini"))
     self.appname = appname