1 file changed, 30 insertions(+) viff/sfdl/grammar.py | 30 ++++++++++++++++++++++++++++++
# HG changeset patch # User Martin Geisler <[EMAIL PROTECTED]> # Date 1227518456 -3600 # Node ID 14a1378185796f4db0fdafe46ee4c774017eb49e # Parent acb9d741bb061ff7efb13601fed4a7f573e77be1 Minimal grammar, parses empty program. diff --git a/viff/sfdl/grammar.py b/viff/sfdl/grammar.py new file mode 100644 --- /dev/null +++ b/viff/sfdl/grammar.py @@ -0,0 +1,30 @@ +# Copyright 2008 VIFF Development Team. +# +# This file is part of VIFF, the Virtual Ideal Functionality Framework. +# +# VIFF is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# VIFF is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with VIFF. If not, see <http://www.gnu.org/licenses/>. + +from pyparsing import Suppress, Word, Keyword, \ + cppStyleComment, alphas, alphanums + +class SFDLGrammar: + + def __init__(self): + LCURLY, RCURLY = Suppress("{"), Suppress("}") + + self.ident = ident = Word(alphas + "_", alphanums + "_") + + self.program = program = Keyword("program") + ident \ + + LCURLY + RCURLY + program.ignore(cppStyleComment) _______________________________________________ viff-patches mailing list viff-patches@viff.dk http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk