BlockIt
blockit::Fortran::grammars Namespace Reference

Classes

class  TestFGrammar

Functions

def setUp
def tearDown
def testUseDecl
def testIntent

Variables

tuple TEMPLATE_TOKENS = ('<','>')
list RESERVED_KEYWORDS = ['template']
tuple COMMENT = pp.Literal( "!" )
tuple CONTINUATION = pp.Literal( "&" )
 INLINE_CONTINUATION = \
tuple VALIDNAME = pp.Word(pp.alphas+'_', pp.alphanums+'_%')
tuple VALIDNAME_WITH_PAREN = VALIDNAME+pp.Optional('('+VALIDNAME+')')
tuple VAR_ASSIGNMENT = VALIDNAME+pp.Literal('=')
tuple NUM = pp.Word(pp.nums)
tuple INTEGER = pp.Combine(pp.Optional('-')+pp.Word(pp.nums))
tuple DECIMAL_NUM = pp.Combine(INTEGER+'.'+pp.Optional(NUM))
tuple ENGINEERING_NUM
tuple PRIVATE = pp.CaselessKeyword('private')
tuple PUBLIC = pp.CaselessKeyword('public')
tuple PROTECTED = pp.CaselessKeyword('protected')
 ACCESS_SPEC = PRIVATE^PUBLIC^PROTECTED
tuple OUT = pp.CaselessKeyword('out')
tuple IN = pp.CaselessKeyword('in')
tuple INOUT = pp.CaselessKeyword('inout')
 INTENT = \
tuple TEMPLATE_DECL = pp.Forward()
tuple VALID_TEMPLATE_PARAM = (pp.Literal('*')|TEMPLATE_DECL|VALIDNAME_WITH_PAREN|INTEGER)
tuple TEMPLATE_PARAM_LIST = (VALID_TEMPLATE_PARAM + pp.ZeroOrMore(','+VALID_TEMPLATE_PARAM))
 adjacent = False)
 ARGLIST = \
 ARGLIST2 = \
tuple TARGET = pp.CaselessKeyword('target')
tuple OPTIONAL = pp.CaselessKeyword('optional')
tuple SAVE = pp.CaselessKeyword('save')
tuple POINTER = pp.CaselessKeyword('pointer')
tuple ALLOCATABLE = pp.CaselessKeyword('allocatable')
tuple EXTERNAL = pp.CaselessKeyword('external')
tuple INTRINSIC = pp.CaselessKeyword('intrinsic')
tuple ASYNCHRONOUS = pp.CaselessKeyword('asynchronous')
tuple VALUE = pp.CaselessKeyword('value')
 DIMENSION = \
 ATTR_SPEC = ACCESS_SPEC|INTENT|TARGET|SAVE|POINTER|ALLOCATABLE|\
 ONLY_CLAUSE = \
 LOGICAL = \
 REAL = \
tuple CHARACTER = pp.CaselessKeyword('character')
 INTRINSIC_TYPE = \
 USE_DECL = \
 TEMPLATE_MOD_PROCEDURE_DECL = \
 IMPORT_DECL = \
 TEMPLATE_TYPE = \
 TEMPLATE_SUB = \
 TEMPLATE_FUNC = \
tuple TEMPLATE_SYMBOL = pp.originalTextFor(TEMPLATE_DECL)
tuple PYF95_KEYWORD = pp.LineStart()
 PYF95_START = \
 PYF95_END = \
 PYF95_EXTERNAL = \
 PYF95_ALWAYSWRITE = \
tuple PYF95_BLOCK = pp.Suppress( PYF95_START )
 bnf = USE_DECL
int ctr = 0
tuple output = bnf.parseString("use DLList<String>")
tuple suite = unittest.TestLoader()

Function Documentation

def blockit::Fortran::grammars::setUp (   self)

Definition at line 220 of file grammars.py.

def blockit::Fortran::grammars::tearDown (   self)

Definition at line 222 of file grammars.py.

def blockit::Fortran::grammars::testIntent (   self)
Checks intent parsing

Definition at line 260 of file grammars.py.

def blockit::Fortran::grammars::testUseDecl (   self)

Definition at line 225 of file grammars.py.


Variable Documentation

Definition at line 73 of file grammars.py.

tuple blockit::Fortran::grammars::ALLOCATABLE = pp.CaselessKeyword('allocatable')

Definition at line 100 of file grammars.py.

Definition at line 75 of file grammars.py.

Definition at line 85 of file grammars.py.

tuple blockit::Fortran::grammars::ASYNCHRONOUS = pp.CaselessKeyword('asynchronous')

Definition at line 103 of file grammars.py.

Checks parsing of use statements

Definition at line 229 of file grammars.py.

tuple blockit::Fortran::grammars::CHARACTER = pp.CaselessKeyword('character')

Definition at line 138 of file grammars.py.

tuple blockit::Fortran::grammars::COMMENT = pp.Literal( "!" )

Definition at line 27 of file grammars.py.

tuple blockit::Fortran::grammars::CONTINUATION = pp.Literal( "&" )

Definition at line 33 of file grammars.py.

Definition at line 233 of file grammars.py.

tuple blockit::Fortran::grammars::DECIMAL_NUM = pp.Combine(INTEGER+'.'+pp.Optional(NUM))

Definition at line 44 of file grammars.py.

Definition at line 105 of file grammars.py.

Initial value:
00001 pp.Combine((DECIMAL_NUM|INTEGER) +\
00002                               pp.oneOf('e d', caseless=True) +\
00003                               INTEGER)

Definition at line 45 of file grammars.py.

tuple blockit::Fortran::grammars::EXTERNAL = pp.CaselessKeyword('external')

Definition at line 101 of file grammars.py.

Definition at line 156 of file grammars.py.

tuple blockit::Fortran::grammars::IN = pp.CaselessKeyword('in')

Definition at line 55 of file grammars.py.

tuple blockit::Fortran::grammars::INOUT = pp.CaselessKeyword('inout')

Definition at line 56 of file grammars.py.

blockit::Fortran::grammars::INTEGER = pp.Combine(pp.Optional('-')+pp.Word(pp.nums))

Definition at line 43 of file grammars.py.

Definition at line 57 of file grammars.py.

tuple blockit::Fortran::grammars::INTRINSIC = pp.CaselessKeyword('intrinsic')

Definition at line 102 of file grammars.py.

Definition at line 127 of file grammars.py.

tuple blockit::Fortran::grammars::NUM = pp.Word(pp.nums)

Definition at line 42 of file grammars.py.

Definition at line 113 of file grammars.py.

tuple blockit::Fortran::grammars::OPTIONAL = pp.CaselessKeyword('optional')

Definition at line 97 of file grammars.py.

tuple blockit::Fortran::grammars::OUT = pp.CaselessKeyword('out')

Definition at line 54 of file grammars.py.

tuple blockit::Fortran::grammars::output = bnf.parseString("use DLList<String>")
        use common_area, only: var1,var2, var3
        use DLList<String>
    

Definition at line 243 of file grammars.py.

tuple blockit::Fortran::grammars::POINTER = pp.CaselessKeyword('pointer')

Definition at line 99 of file grammars.py.

tuple blockit::Fortran::grammars::PRIVATE = pp.CaselessKeyword('private')

Definition at line 49 of file grammars.py.

tuple blockit::Fortran::grammars::PROTECTED = pp.CaselessKeyword('protected')

Definition at line 51 of file grammars.py.

tuple blockit::Fortran::grammars::PUBLIC = pp.CaselessKeyword('public')

Definition at line 50 of file grammars.py.

Definition at line 204 of file grammars.py.

Definition at line 189 of file grammars.py.

Definition at line 185 of file grammars.py.

Definition at line 186 of file grammars.py.

Definition at line 130 of file grammars.py.

Definition at line 25 of file grammars.py.

tuple blockit::Fortran::grammars::SAVE = pp.CaselessKeyword('save')

Definition at line 98 of file grammars.py.

tuple blockit::Fortran::grammars::suite = unittest.TestLoader()

Definition at line 284 of file grammars.py.

tuple blockit::Fortran::grammars::TARGET = pp.CaselessKeyword('target')

Definition at line 96 of file grammars.py.

Definition at line 67 of file grammars.py.

Definition at line 169 of file grammars.py.

Definition at line 178 of file grammars.py.

Definition at line 24 of file grammars.py.

Definition at line 145 of file grammars.py.

tuple blockit::Fortran::grammars::VALIDNAME = pp.Word(pp.alphas+'_', pp.alphanums+'_%')

Definition at line 39 of file grammars.py.

Definition at line 40 of file grammars.py.

tuple blockit::Fortran::grammars::VALUE = pp.CaselessKeyword('value')

Definition at line 104 of file grammars.py.

Definition at line 41 of file grammars.py.

 All Classes Namespaces Files Functions Variables Properties