Thread: [MMTP-devel] SF.net SVN: mtp: [22] trunk
Status: Pre-Alpha
Brought to you by:
idominguez
|
From: <ido...@us...> - 2007-12-06 12:55:11
|
Revision: 22
http://mtp.svn.sourceforge.net/mtp/?rev=22&view=rev
Author: idominguez
Date: 2007-12-06 04:54:52 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
IMDEA removed as copyright holder
Modified Paths:
--------------
trunk/java-file-header
trunk/src/mtp/synthesis/JavaCCSynthesis.java
Modified: trunk/java-file-header
===================================================================
--- trunk/java-file-header 2007-12-06 00:59:01 UTC (rev 21)
+++ trunk/java-file-header 2007-12-06 12:54:52 UTC (rev 22)
@@ -2,7 +2,6 @@
* @(#)<filename>.java -- <a brief idea of what the file does>
*
* Copyright (C) 2007 by Ivan Perez-Dominguez
- * (IMDEA Software and Babel Group)
* iperez_at_babel.ls.fi.upm.es
*
* This file is part of MuchMoreThanParsing.
Modified: trunk/src/mtp/synthesis/JavaCCSynthesis.java
===================================================================
--- trunk/src/mtp/synthesis/JavaCCSynthesis.java 2007-12-06 00:59:01 UTC (rev 21)
+++ trunk/src/mtp/synthesis/JavaCCSynthesis.java 2007-12-06 12:54:52 UTC (rev 22)
@@ -2,7 +2,7 @@
* @(#)JavaCCSynthesis -- Class to print a JavaCC parser
*
* Copyright (C) 2004 by Babel Group, Univ. Politecnica de Madrid
- * Copyright (C) 2007 by Ivan Perez (IMDEA Software & Babel Group)
+ * Copyright (C) 2007 by Ivan Perez-Dominguez
*
* This file is part of MMTP.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-06 13:05:51
|
Revision: 24
http://mtp.svn.sourceforge.net/mtp/?rev=24&view=rev
Author: idominguez
Date: 2007-12-06 05:05:48 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
checkstyle sun-based list of checks added as xml
file and call added in ant script
Modified Paths:
--------------
trunk/build.xml
Added Paths:
-----------
trunk/build/sun_checks.xml
Added: trunk/build/sun_checks.xml
===================================================================
--- trunk/build/sun_checks.xml (rev 0)
+++ trunk/build/sun_checks.xml 2007-12-06 13:05:48 UTC (rev 24)
@@ -0,0 +1,175 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<!--
+
+ Checkstyle configuration that checks the sun coding conventions from:
+
+ - the Java Language Specification at
+ http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+ - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+ - the Javadoc guidelines at
+ http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+ - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+ - some best practices
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sf.net (or in your downloaded distribution).
+
+ Most Checks are configurable, be sure to consult the documentation.
+
+ To completely disable a check, just comment it out or delete it from the file.
+
+ Finally, it is worth reading the documentation.
+
+-->
+<module name="Checker">
+
+ <!-- Checks that a package.html file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+ <!--module name="PackageHtml"/-->
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <module name="NewlineAtEndOfFile"/>
+
+ <!-- Checks that property files contain the same keys. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+ <module name="Translation"/>
+
+
+ <module name="TreeWalker">
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocMethod"/>
+ <module name="JavadocType"/>
+ <module name="JavadocVariable"/>
+ <module name="JavadocStyle"/>
+
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+
+
+ <!-- Checks for Headers -->
+ <!-- See http://checkstyle.sf.net/config_header.html -->
+ <!-- <module name="Header"> -->
+ <!-- The follow property value demonstrates the ability -->
+ <!-- to have access to ANT properties. In this case it uses -->
+ <!-- the ${basedir} property to allow Checkstyle to be run -->
+ <!-- from any directory within a project. See property -->
+ <!-- expansion, -->
+ <!-- http://checkstyle.sf.net/config.html#properties -->
+ <!-- <property -->
+ <!-- name="headerFile" -->
+ <!-- value="${basedir}/java.header"/> -->
+ <!-- </module> -->
+
+ <!-- Following interprets the header file as regular expressions. -->
+ <!-- <module name="RegexpHeader"/> -->
+
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="FileLength"/>
+ <module name="LineLength"/>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="20"/>
+ <property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
+ </module>
+
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="EmptyForIteratorPad"/>
+ <module name="MethodParamPad">
+ <property name="tokens" value="SUPER_CTOR_CALL"/>
+ </module>
+ <!--module name="NoWhitespaceAfter"//-->
+ <module name="NoWhitespaceBefore"/>
+ <module name="OperatorWrap"/>
+ <module name="ParenPad"/>
+ <module name="TypecastParenPad"/>
+ <module name="TabCharacter"/>
+ <module name="WhitespaceAfter"/>
+ <module name="WhitespaceAround">
+ <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND, WILDCARD_TYPE" />
+ </module>
+
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock"/>
+ <!--module name="LeftCurly"//-->
+ <module name="NeedBraces"/>
+ <!--module name="RightCurly"//-->
+
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <module name="AvoidInlineConditionals"/>
+ <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField"/>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <module name="DesignForExtension"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier"/>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <!--module name="FinalParameters"//-->
+ <module name="GenericIllegalRegexp">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Line has trailing spaces."/>
+ </module>
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ </module>
+
+</module>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2007-12-06 13:04:51 UTC (rev 23)
+++ trunk/build.xml 2007-12-06 13:05:48 UTC (rev 24)
@@ -31,6 +31,17 @@
</javadoc>
</target>
+<taskdef resource="checkstyletask.properties" />
+
+<target name="checkstyle" description="Checks the style of the code">
+ <checkstyle config="build/sun_checks.xml" >
+ <fileset dir="src">
+ <include name="mtp/analysis/*.java"/>
+ </fileset>
+ </checkstyle>
+</target>
+
+
<target name="compile" description="compiles the source">
<ant antfile="${mtp}/build.xml" target="compile-jar" />
<mtpscript />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-06 14:19:14
|
Revision: 30
http://mtp.svn.sourceforge.net/mtp/?rev=30&view=rev
Author: idominguez
Date: 2007-12-06 06:19:06 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
* Two bnf grammars added as tests, and enabled in build.xml
* Error in Bnf.mtp corrected
Modified Paths:
--------------
trunk/examples/Bnf.mtp
trunk/tests/build.xml
Added Paths:
-----------
trunk/tests/bnf/test1.bnf.ok
trunk/tests/bnf/test2.bnf.fail
Modified: trunk/examples/Bnf.mtp
===================================================================
--- trunk/examples/Bnf.mtp 2007-12-06 14:01:37 UTC (rev 29)
+++ trunk/examples/Bnf.mtp 2007-12-06 14:19:06 UTC (rev 30)
@@ -31,10 +31,12 @@
ExpressionList ::= (Expression (VBAR Expression)* );
-Expression ::= RuleName
- | Literal
- ;
+Expression ::= (Term)+;
+Term ::= RuleName
+ | Literal
+ ;
+
RuleName ::= RULE_NAME;
Literal ::= LITERAL;
Added: trunk/tests/bnf/test1.bnf.ok
===================================================================
--- trunk/tests/bnf/test1.bnf.ok (rev 0)
+++ trunk/tests/bnf/test1.bnf.ok 2007-12-06 14:19:06 UTC (rev 30)
@@ -0,0 +1,3 @@
+<addition> ::= <number> | <plusexpr>
+<number> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
+<plusexpr> ::= <number> '+' <addition>
Added: trunk/tests/bnf/test2.bnf.fail
===================================================================
--- trunk/tests/bnf/test2.bnf.fail (rev 0)
+++ trunk/tests/bnf/test2.bnf.fail 2007-12-06 14:19:06 UTC (rev 30)
@@ -0,0 +1,3 @@
+<Addition> ::= <number> | <plusexpr>
+<number> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
+<plusexpr> ::= <number> '+' <addition>
Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml 2007-12-06 14:01:37 UTC (rev 29)
+++ trunk/tests/build.xml 2007-12-06 14:19:06 UTC (rev 30)
@@ -26,6 +26,8 @@
<test-parser destdir="simpleparenmaths" mustfail="true" input="test2.fail" />
<test-parser destdir="simpleparenmaths" mustfail="false" input="test3.ok" />
<test-parser destdir="simpleparenmaths" mustfail="false" input="test4.ok" />
+ <test-parser destdir="bnf" mustfail="false" input="test1.bnf.ok" />
+ <test-parser destdir="bnf" mustfail="true" input="test2.bnf.fail" />
<!--test-parser destdir="mtpll1_old" mustfail="false" input="naturals.mtp.ok" />
<test-parser destdir="mtpll1_old" mustfail="false" input="po.mtp.ok" />
<test-parser destdir="mtpll1_old" mustfail="false" input="reals.mtp.ok" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-06 15:21:44
|
Revision: 34
http://mtp.svn.sourceforge.net/mtp/?rev=34&view=rev
Author: idominguez
Date: 2007-12-06 07:21:40 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
New mmtp extension used in all examples, and inside
mmtp's code
Modified Paths:
--------------
trunk/src/mtp/analysis/SymTabBuilder.java
trunk/tests/build.xml
Added Paths:
-----------
trunk/examples/BImplementations.mmtp
trunk/examples/BMachines.mmtp
trunk/examples/BRefinements.mmtp
trunk/examples/Bnf.mmtp
trunk/examples/C.mmtp
trunk/examples/Cobol.mmtp
trunk/examples/Cup.mmtp
trunk/examples/ada.mmtp
trunk/examples/domain_name.mmtp
trunk/examples/extmtp.mmtp
trunk/examples/mpsub.mmtp
trunk/examples/mtp.mmtp
trunk/examples/mtpll.mmtp
trunk/examples/mtpll1_old.mmtp
trunk/examples/naturals.mmtp
trunk/examples/pascal.mmtp
trunk/examples/po.mmtp
trunk/examples/qualified_mtp.mmtp
trunk/examples/reals.mmtp
trunk/examples/simplemaths.mmtp
trunk/examples/simpleparenmaths.mmtp
trunk/examples/smtp.mmtp
trunk/examples/stdmtp.mmtp
trunk/examples/sub.mmtp
trunk/examples/tiger.mmtp
trunk/examples/tigerll.mmtp
trunk/tests/Bnf.mtp
trunk/tests/PO.mtp
trunk/tests/SimpleMaths.mtp
trunk/tests/SimpleParenMaths.mtp
trunk/tests/mtpll1_old.mtp
trunk/tests/naturals.mtp
Removed Paths:
-------------
trunk/examples/BImplementations.mtp
trunk/examples/BMachines.mtp
trunk/examples/BRefinements.mtp
trunk/examples/Bnf.mtp
trunk/examples/C.mtp
trunk/examples/Cobol.mtp
trunk/examples/Cup.mtp
trunk/examples/ada.mtp
trunk/examples/domain_name.mtp
trunk/examples/extmtp.mtp
trunk/examples/mpsub.mtp
trunk/examples/mtp.mtp
trunk/examples/mtpll.mtp
trunk/examples/mtpll1_old.mtp
trunk/examples/naturals.mtp
trunk/examples/pascal.mtp
trunk/examples/po.mtp
trunk/examples/qualified_mtp.mtp
trunk/examples/reals.mtp
trunk/examples/simplemaths.mtp
trunk/examples/simpleparenmaths.mtp
trunk/examples/smtp.mtp
trunk/examples/stdmtp.mtp
trunk/examples/sub.mtp
trunk/examples/tiger.mtp
trunk/examples/tigerll.mtp
trunk/tests/Bnf.mtp
trunk/tests/PO.mtp
trunk/tests/SimpleMaths.mtp
trunk/tests/SimpleParenMaths.mtp
trunk/tests/mtpll1_old.mtp
trunk/tests/naturals.mtp
Copied: trunk/examples/BImplementations.mmtp (from rev 33, trunk/examples/BImplementations.mtp)
===================================================================
--- trunk/examples/BImplementations.mmtp (rev 0)
+++ trunk/examples/BImplementations.mmtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -0,0 +1,136 @@
+MODULE BImplementations
+
+SIGNATURE
+ ASSERTIONS = "ASSERTIONS";
+ CONSTANTS = "CONSTANTS";
+ CONSTRAINTS = "CONSTRAINTS";
+ DEFINITIONS = "DEFINITIONS";
+ END = "END";
+ EXTENDS = "EXTENDS";
+ INCLUDES = "INCLUDES";
+ INITIALISATION = "INITIALISAT";
+ INVARIANT = "INVARIANT";
+ MACHINE = "MACHINE";
+ OPERATIONS = "OPERATIONS";
+ PROMOTES = "PROMOTES";
+ PROPERTIES = "PROPERTIES";
+ SEES = "SEES";
+ SETS = "SETS";
+ USES = "USES";
+ VARIABLES = "VARIABLES";
+
+ LCB = "{";
+ RCB = "}";
+ LPAR = "(";
+ RPAR = ")";
+ DOT = ".";
+ AMPERSAND = "&";
+ COMMA = ",";
+ SEMICOLON = ";";
+ LARROW = "<--";
+ EQUAL = "=";
+ EQEQ = "==";
+ UNDERSCORE = "_";
+
+ IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
+ LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+ UPPERCASEIDENTIFIER = UPPERCASE_LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+
+ /*
+ UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
+ UPPERCASE_LETTER
+ (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
+ */
+ LETTER = ['A'-'Z','a'-'z'];
+ DIGIT = ['0'-'9'];
+ UPPERCASE_LETTER = ['A'-'Z'];
+
+ /* Could be a bit more restrictive */
+ NUM = (DIGIT)*;
+
+ /* Could be too restrictive (we are not allowing either \r nor \n
+ inside a string) */
+ STRING = "\"" (~['\"','\r','\n'])* "\"";
+
+AXIOM ImplementationSpec;
+
+GRAMMAR
+
+ImpementationSpec ::= ImplementationDecl
+ RefinesDecl
+ (SeesDecl)?
+ (ImportsDecl)?
+ (PromotesDecl)?
+ (SetsDecl)?
+ (ConstantsDecl)?
+ (PropertiesDecl)?
+ (InvariantDecl)?
+ (AssertionsDecl)?
+ (DefinitionsDecl)?
+ (InitialisationDecl)?
+ (OperationsDecl)?
+ END;
+
+ImplementationDecl ::= IMPLEMENTATION Identifier;
+RefinesDecl ::= REFINES MachineRef;
+SeesDecl ::= MachineRef (COMMA MachineRef)*;
+ImportsDecl ::= ImportsDecl MachineCallWithActParam
+ (COMMA MachineCallWithActParams)*;
+
+MachineCallWithActParams ::= MachineRef (LPAR ActParamList RPAR)?;
+PromotesDecl ::= PROMOTES OperationRef (COMMA OperationRef)*;
+
+ SetsDecl ::= SetsDeclOfIdentifier
+ | SetsDeclOfEnumeratedSets;
+ SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
+ SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
+ ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
+
+ PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
+
+ InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
+
+ AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
+
+ DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
+ (SEMICOLON Formula EQEQ Formula)*;
+
+ InitialisationDecl ::= INITIALISATION Formula;
+
+ OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
+
+ MachineRef ::= Identifier;
+
+ ParamList ::= Identifier (COMMA Identifier)*;
+
+ ActParamList ::= ActParam (COMMA ActParam)*;
+
+ ActParam ::= ActBNumber
+ | ActIdentifier
+ | ActFormula
+ | ActRange
+ | ActArray
+ ;
+ ActBNumber ::= BNumber;
+ ActIdentifier ::= Identifier;
+ ActFormula ::= Formula;
+ ActBRange ::= BNumber DOUBLE_DOT BNumber;
+ ActArray ::= LCB SetContents RCB;
+ EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
+
+ SetContents ::= SetContentsOfIdentifiers
+ | SetContentsOfBNumbers;
+
+ SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
+ SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
+
+ Operation ::= (ParamList LARROW)? Identifier
+ (LPAR ParamList RPAR)?
+ EQUAL ProgramLikeFormula;
+
+ Identifier ::= IDENTIFIER;
+
+ UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
+
Deleted: trunk/examples/BImplementations.mtp
===================================================================
--- trunk/examples/BImplementations.mtp 2007-12-06 15:05:20 UTC (rev 33)
+++ trunk/examples/BImplementations.mtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -1,136 +0,0 @@
-MODULE BImplementations
-
-SIGNATURE
- ASSERTIONS = "ASSERTIONS";
- CONSTANTS = "CONSTANTS";
- CONSTRAINTS = "CONSTRAINTS";
- DEFINITIONS = "DEFINITIONS";
- END = "END";
- EXTENDS = "EXTENDS";
- INCLUDES = "INCLUDES";
- INITIALISATION = "INITIALISAT";
- INVARIANT = "INVARIANT";
- MACHINE = "MACHINE";
- OPERATIONS = "OPERATIONS";
- PROMOTES = "PROMOTES";
- PROPERTIES = "PROPERTIES";
- SEES = "SEES";
- SETS = "SETS";
- USES = "USES";
- VARIABLES = "VARIABLES";
-
- LCB = "{";
- RCB = "}";
- LPAR = "(";
- RPAR = ")";
- DOT = ".";
- AMPERSAND = "&";
- COMMA = ",";
- SEMICOLON = ";";
- LARROW = "<--";
- EQUAL = "=";
- EQEQ = "==";
- UNDERSCORE = "_";
-
- IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
- LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
- UPPERCASEIDENTIFIER = UPPERCASE_LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
-
- /*
- UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
- UPPERCASE_LETTER
- (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
- */
- LETTER = ['A'-'Z','a'-'z'];
- DIGIT = ['0'-'9'];
- UPPERCASE_LETTER = ['A'-'Z'];
-
- /* Could be a bit more restrictive */
- NUM = (DIGIT)*;
-
- /* Could be too restrictive (we are not allowing either \r nor \n
- inside a string) */
- STRING = "\"" (~['\"','\r','\n'])* "\"";
-
-AXIOM ImplementationSpec;
-
-GRAMMAR
-
-ImpementationSpec ::= ImplementationDecl
- RefinesDecl
- (SeesDecl)?
- (ImportsDecl)?
- (PromotesDecl)?
- (SetsDecl)?
- (ConstantsDecl)?
- (PropertiesDecl)?
- (InvariantDecl)?
- (AssertionsDecl)?
- (DefinitionsDecl)?
- (InitialisationDecl)?
- (OperationsDecl)?
- END;
-
-ImplementationDecl ::= IMPLEMENTATION Identifier;
-RefinesDecl ::= REFINES MachineRef;
-SeesDecl ::= MachineRef (COMMA MachineRef)*;
-ImportsDecl ::= ImportsDecl MachineCallWithActParam
- (COMMA MachineCallWithActParams)*;
-
-MachineCallWithActParams ::= MachineRef (LPAR ActParamList RPAR)?;
-PromotesDecl ::= PROMOTES OperationRef (COMMA OperationRef)*;
-
- SetsDecl ::= SetsDeclOfIdentifier
- | SetsDeclOfEnumeratedSets;
- SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
- SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
- ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
-
- PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
-
- InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
-
- AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
-
- DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
- (SEMICOLON Formula EQEQ Formula)*;
-
- InitialisationDecl ::= INITIALISATION Formula;
-
- OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
-
- MachineRef ::= Identifier;
-
- ParamList ::= Identifier (COMMA Identifier)*;
-
- ActParamList ::= ActParam (COMMA ActParam)*;
-
- ActParam ::= ActBNumber
- | ActIdentifier
- | ActFormula
- | ActRange
- | ActArray
- ;
- ActBNumber ::= BNumber;
- ActIdentifier ::= Identifier;
- ActFormula ::= Formula;
- ActBRange ::= BNumber DOUBLE_DOT BNumber;
- ActArray ::= LCB SetContents RCB;
- EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
-
- SetContents ::= SetContentsOfIdentifiers
- | SetContentsOfBNumbers;
-
- SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
- SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
-
- Operation ::= (ParamList LARROW)? Identifier
- (LPAR ParamList RPAR)?
- EQUAL ProgramLikeFormula;
-
- Identifier ::= IDENTIFIER;
-
- UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
-
Copied: trunk/examples/BMachines.mmtp (from rev 33, trunk/examples/BMachines.mtp)
===================================================================
--- trunk/examples/BMachines.mmtp (rev 0)
+++ trunk/examples/BMachines.mmtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -0,0 +1,142 @@
+MODULE BMachines
+
+SIGNATURE
+ ASSERTIONS = "ASSERTIONS";
+ CONSTANTS = "CONSTANTS";
+ CONSTRAINTS = "CONSTRAINTS";
+ DEFINITIONS = "DEFINITIONS";
+ END = "END";
+ EXTENDS = "EXTENDS";
+ INCLUDES = "INCLUDES";
+ INITIALISATION = "INITIALISAT";
+ INVARIANT = "INVARIANT";
+ MACHINE = "MACHINE";
+ OPERATIONS = "OPERATIONS";
+ PROMOTES = "PROMOTES";
+ PROPERTIES = "PROPERTIES";
+ SEES = "SEES";
+ SETS = "SETS";
+ USES = "USES";
+ VARIABLES = "VARIABLES";
+
+ LCB = "{";
+ RCB = "}";
+ LPAR = "(";
+ RPAR = ")";
+ DOT = ".";
+ AMPERSAND = "&";
+ COMMA = ",";
+ SEMICOLON = ";";
+ LARROW = "<--";
+ EQUAL = "=";
+ EQEQ = "==";
+ UNDERSCORE = "_";
+
+ IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
+ LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+ UPPERCASEIDENTIFIER = UPPERCASE_LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+
+ /*
+ UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
+ UPPERCASE_LETTER
+ (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
+ */
+ LETTER = ['A'-'Z','a'-'z'];
+ DIGIT = ['0'-'9'];
+ UPPERCASE_LETTER = ['A'-'Z'];
+
+ /* Could be a bit more restrictive */
+ NUM = (DIGIT)*;
+
+ /* Could be too restrictive (we are not allowing either \r nor \n
+ inside a string) */
+ STRING = "\"" (~['\"','\r','\n'])* "\"";
+
+AXIOM MachineSpec;
+
+GRAMMAR
+
+MachineSpec ::= MachineDecl
+ (ConstraintsDecl)?
+ (UsesDecl)?
+ (SeesDecl)?
+ (IncludesDecl)?
+ (PromotesDecl)?
+ (ExtendsDecl)?
+ (SetsDecl)?
+ (ConstantsDecl)?
+ (PropertiesDecl)?
+ (VariablesDecl)?
+ (InvariantDecl)?
+ (AssertionsDecl)?
+ (DefinitionsDecl)?
+ (InitialisationDecl)?
+ (OperationsDecl)?
+ END;
+
+MachineDecl ::= MACHINE Identifier ( LPAR ParamList RPAR )?;
+
+ConstraintsDecl ::= CONSTRAINTS Formula (AMPERSAND Formula)*;
+
+UsesDecl ::= USES RnmMachineRef (COMMA RnmMachineRef)*;
+
+SeesDecl ::= SEES RnmMachineRef (COMMA RnmMachineRef)*;
+
+IncludesDecl ::= INCLUDES RnmMachineCall
+ (COMMA RnmMachineCall)*;
+
+RnmMachineRefCall ::= RnmMachineRef (LPAR ParamList RPAR)?;
+
+PromotesDecl ::= PROMOTES RnmOperationRef (COMMA RnmOperationRef)*;
+
+ExtendsDecl ::= EXTENDS RnmMachineRefCall
+ (COMMA RnmMachineRefCall)*;
+
+SetsDecl ::= SetsDeclOfIdentifier
+ | SetsDeclOfEnumeratedSets;
+
+SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
+SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
+ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
+
+PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
+
+VariablesDecl ::= VARIABLES Identifier (COMMA Identifier)*;
+
+InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
+
+AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
+
+DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
+ (SEMICOLON Formula EQEQ Formula)*;
+
+InitialisationDecl ::= INITIALISATION Formula;
+
+OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
+
+ParamList ::= Identifier (COMMA Identifier)*;
+
+EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
+
+SetContents ::= SetContentsOfIdentifiers
+ | SetContentsOfBNumbers;
+
+SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
+SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
+
+RnmMachineRef ::= (RenamePrefix DOT)? Identifier;
+
+RnmOperationRef ::= (RenamePrefix DOT)? Identifier;
+
+RenamePrefix ::= Identifier;
+
+Operation ::= (ParamList LARROW)? Identifier
+ (LPAR ParamList RPAR)?
+ EQUAL ProgramLikeFormula;
+
+Identifier ::= IDENTIFIER;
+
+UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
+
Deleted: trunk/examples/BMachines.mtp
===================================================================
--- trunk/examples/BMachines.mtp 2007-12-06 15:05:20 UTC (rev 33)
+++ trunk/examples/BMachines.mtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -1,142 +0,0 @@
-MODULE BMachines
-
-SIGNATURE
- ASSERTIONS = "ASSERTIONS";
- CONSTANTS = "CONSTANTS";
- CONSTRAINTS = "CONSTRAINTS";
- DEFINITIONS = "DEFINITIONS";
- END = "END";
- EXTENDS = "EXTENDS";
- INCLUDES = "INCLUDES";
- INITIALISATION = "INITIALISAT";
- INVARIANT = "INVARIANT";
- MACHINE = "MACHINE";
- OPERATIONS = "OPERATIONS";
- PROMOTES = "PROMOTES";
- PROPERTIES = "PROPERTIES";
- SEES = "SEES";
- SETS = "SETS";
- USES = "USES";
- VARIABLES = "VARIABLES";
-
- LCB = "{";
- RCB = "}";
- LPAR = "(";
- RPAR = ")";
- DOT = ".";
- AMPERSAND = "&";
- COMMA = ",";
- SEMICOLON = ";";
- LARROW = "<--";
- EQUAL = "=";
- EQEQ = "==";
- UNDERSCORE = "_";
-
- IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
- LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
- UPPERCASEIDENTIFIER = UPPERCASE_LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
-
- /*
- UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
- UPPERCASE_LETTER
- (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
- */
- LETTER = ['A'-'Z','a'-'z'];
- DIGIT = ['0'-'9'];
- UPPERCASE_LETTER = ['A'-'Z'];
-
- /* Could be a bit more restrictive */
- NUM = (DIGIT)*;
-
- /* Could be too restrictive (we are not allowing either \r nor \n
- inside a string) */
- STRING = "\"" (~['\"','\r','\n'])* "\"";
-
-AXIOM MachineSpec;
-
-GRAMMAR
-
-MachineSpec ::= MachineDecl
- (ConstraintsDecl)?
- (UsesDecl)?
- (SeesDecl)?
- (IncludesDecl)?
- (PromotesDecl)?
- (ExtendsDecl)?
- (SetsDecl)?
- (ConstantsDecl)?
- (PropertiesDecl)?
- (VariablesDecl)?
- (InvariantDecl)?
- (AssertionsDecl)?
- (DefinitionsDecl)?
- (InitialisationDecl)?
- (OperationsDecl)?
- END;
-
-MachineDecl ::= MACHINE Identifier ( LPAR ParamList RPAR )?;
-
-ConstraintsDecl ::= CONSTRAINTS Formula (AMPERSAND Formula)*;
-
-UsesDecl ::= USES RnmMachineRef (COMMA RnmMachineRef)*;
-
-SeesDecl ::= SEES RnmMachineRef (COMMA RnmMachineRef)*;
-
-IncludesDecl ::= INCLUDES RnmMachineCall
- (COMMA RnmMachineCall)*;
-
-RnmMachineRefCall ::= RnmMachineRef (LPAR ParamList RPAR)?;
-
-PromotesDecl ::= PROMOTES RnmOperationRef (COMMA RnmOperationRef)*;
-
-ExtendsDecl ::= EXTENDS RnmMachineRefCall
- (COMMA RnmMachineRefCall)*;
-
-SetsDecl ::= SetsDeclOfIdentifier
- | SetsDeclOfEnumeratedSets;
-
-SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
-SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
-ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
-
-PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
-
-VariablesDecl ::= VARIABLES Identifier (COMMA Identifier)*;
-
-InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
-
-AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
-
-DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
- (SEMICOLON Formula EQEQ Formula)*;
-
-InitialisationDecl ::= INITIALISATION Formula;
-
-OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
-
-ParamList ::= Identifier (COMMA Identifier)*;
-
-EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
-
-SetContents ::= SetContentsOfIdentifiers
- | SetContentsOfBNumbers;
-
-SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
-SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
-
-RnmMachineRef ::= (RenamePrefix DOT)? Identifier;
-
-RnmOperationRef ::= (RenamePrefix DOT)? Identifier;
-
-RenamePrefix ::= Identifier;
-
-Operation ::= (ParamList LARROW)? Identifier
- (LPAR ParamList RPAR)?
- EQUAL ProgramLikeFormula;
-
-Identifier ::= IDENTIFIER;
-
-UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
-
Copied: trunk/examples/BRefinements.mmtp (from rev 33, trunk/examples/BRefinements.mtp)
===================================================================
--- trunk/examples/BRefinements.mmtp (rev 0)
+++ trunk/examples/BRefinements.mmtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -0,0 +1,117 @@
+MODULE BRefinements
+
+SIGNATURE
+ ASSERTIONS = "ASSERTIONS";
+ CONSTANTS = "CONSTANTS";
+ CONSTRAINTS = "CONSTRAINTS";
+ DEFINITIONS = "DEFINITIONS";
+ END = "END";
+ EXTENDS = "EXTENDS";
+ INCLUDES = "INCLUDES";
+ INITIALISATION = "INITIALISAT";
+ INVARIANT = "INVARIANT";
+ MACHINE = "MACHINE";
+ OPERATIONS = "OPERATIONS";
+ PROMOTES = "PROMOTES";
+ PROPERTIES = "PROPERTIES";
+ SEES = "SEES";
+ SETS = "SETS";
+ USES = "USES";
+ VARIABLES = "VARIABLES";
+
+ LCB = "{";
+ RCB = "}";
+ LPAR = "(";
+ RPAR = ")";
+ DOT = ".";
+ AMPERSAND = "&";
+ COMMA = ",";
+ SEMICOLON = ";";
+ LARROW = "<--";
+ EQUAL = "=";
+ EQEQ = "==";
+ UNDERSCORE = "_";
+
+ IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
+ LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+ UPPERCASEIDENTIFIER = UPPERCASE_LETTER
+ (LETTER | DIGIT | UNDERSCORE)*;
+
+ /*
+ UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
+ UPPERCASE_LETTER
+ (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
+ */
+ LETTER = ['A'-'Z','a'-'z'];
+ DIGIT = ['0'-'9'];
+ UPPERCASE_LETTER = ['A'-'Z'];
+
+ /* Could be a bit more restrictive */
+ NUM = (DIGIT)*;
+
+ /* Could be too restrictive (we are not allowing either \r nor \n
+ inside a string) */
+ STRING = "\"" (~['\"','\r','\n'])* "\"";
+
+AXIOM RefinementSpec;
+
+GRAMMAR
+ RefinementSpec ::= RefinementDecl
+ RefinesDecl
+ (SeesDecl)?
+ (SetsDecl)?
+ (ConstantsDecl)?
+ (PropertiesDecl)?
+ (VariablesDecl)?
+ (InvariantDecl)?
+ (AssertionsDecl)?
+ (DefinitionsDecl)?
+ (InitialisationDecl)?
+ (OperationsDecl)?
+ END;
+
+ RefinementDecl ::= REFINEMENT Identifier;
+ RefinesDecl ::= REFINES MachineRef;
+ SeesDecl ::= MachineRef (COMMA MachineRef)*;
+ SetsDecl ::= SetsDeclOfIdentifier
+ | SetsDeclOfEnumeratedSets;
+ SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
+ SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
+ ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
+
+ PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
+
+ VariablesDecl ::= VARIABLES Identifier (COMMA Identifier)*;
+
+ InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
+
+ AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
+
+ DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
+ (SEMICOLON Formula EQEQ Formula)*;
+
+ InitialisationDecl ::= INITIALISATION Formula;
+
+ OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
+
+ MachineRef ::= Identifier;
+
+ ParamList ::= Identifier (COMMA Identifier)*;
+
+ EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
+
+ SetContents ::= SetContentsOfIdentifiers
+ | SetContentsOfBNumbers;
+
+ SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
+ SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
+
+ Operation ::= (ParamList LARROW)? Identifier
+ (LPAR ParamList RPAR)?
+ EQUAL ProgramLikeFormula;
+
+ Identifier ::= IDENTIFIER;
+
+ UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
+
Deleted: trunk/examples/BRefinements.mtp
===================================================================
--- trunk/examples/BRefinements.mtp 2007-12-06 15:05:20 UTC (rev 33)
+++ trunk/examples/BRefinements.mtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -1,117 +0,0 @@
-MODULE BRefinements
-
-SIGNATURE
- ASSERTIONS = "ASSERTIONS";
- CONSTANTS = "CONSTANTS";
- CONSTRAINTS = "CONSTRAINTS";
- DEFINITIONS = "DEFINITIONS";
- END = "END";
- EXTENDS = "EXTENDS";
- INCLUDES = "INCLUDES";
- INITIALISATION = "INITIALISAT";
- INVARIANT = "INVARIANT";
- MACHINE = "MACHINE";
- OPERATIONS = "OPERATIONS";
- PROMOTES = "PROMOTES";
- PROPERTIES = "PROPERTIES";
- SEES = "SEES";
- SETS = "SETS";
- USES = "USES";
- VARIABLES = "VARIABLES";
-
- LCB = "{";
- RCB = "}";
- LPAR = "(";
- RPAR = ")";
- DOT = ".";
- AMPERSAND = "&";
- COMMA = ",";
- SEMICOLON = ";";
- LARROW = "<--";
- EQUAL = "=";
- EQEQ = "==";
- UNDERSCORE = "_";
-
- IDENTIFIER = (LETTER | DIGIT | UNDERSCORE)*
- LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
- UPPERCASEIDENTIFIER = UPPERCASE_LETTER
- (LETTER | DIGIT | UNDERSCORE)*;
-
- /*
- UPPERCASEIDENTIFIER = (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*
- UPPERCASE_LETTER
- (UPPERCASE_LETTER | DIGIT | UNDERSCORE)*;
- */
- LETTER = ['A'-'Z','a'-'z'];
- DIGIT = ['0'-'9'];
- UPPERCASE_LETTER = ['A'-'Z'];
-
- /* Could be a bit more restrictive */
- NUM = (DIGIT)*;
-
- /* Could be too restrictive (we are not allowing either \r nor \n
- inside a string) */
- STRING = "\"" (~['\"','\r','\n'])* "\"";
-
-AXIOM RefinementSpec;
-
-GRAMMAR
- RefinementSpec ::= RefinementDecl
- RefinesDecl
- (SeesDecl)?
- (SetsDecl)?
- (ConstantsDecl)?
- (PropertiesDecl)?
- (VariablesDecl)?
- (InvariantDecl)?
- (AssertionsDecl)?
- (DefinitionsDecl)?
- (InitialisationDecl)?
- (OperationsDecl)?
- END;
-
- RefinementDecl ::= REFINEMENT Identifier;
- RefinesDecl ::= REFINES MachineRef;
- SeesDecl ::= MachineRef (COMMA MachineRef)*;
- SetsDecl ::= SetsDeclOfIdentifier
- | SetsDeclOfEnumeratedSets;
- SetsDeclOfIdentifier ::= SETS UpperCaseIdentifier (SEMICOLON UpperCaseIdentifier)*;
- SetsDeclOfEnumeratedSets ::= SETS EnumeratedSet (SEMICOLON UpperCaseIdentifier)*;
- ConstantsDecl ::= CONSTANTS Identifier (COMMA Identifier)*;
-
- PropertiesDecl ::= PROPERTIES Formula (AMPERSAND Formula)*;
-
- VariablesDecl ::= VARIABLES Identifier (COMMA Identifier)*;
-
- InvariantDecl ::= INVARIANT Formula (AMPERSAND Formula)*;
-
- AssertionsDecl ::= ASSERTIONS Formula (AMPERSAND Formula)*;
-
- DefinitionsDecl ::= DEFINITIONS Formula EQEQ Formula
- (SEMICOLON Formula EQEQ Formula)*;
-
- InitialisationDecl ::= INITIALISATION Formula;
-
- OperationsDecl ::= OPERATIONS Operation (SEMICOLON Operation)*;
-
- MachineRef ::= Identifier;
-
- ParamList ::= Identifier (COMMA Identifier)*;
-
- EnumeratedSet ::= UpperCaseIdentifier EQUAL LCB SetContents RCB;
-
- SetContents ::= SetContentsOfIdentifiers
- | SetContentsOfBNumbers;
-
- SetContentsOfIdentifiers ::= Identifier (COMMA Identifier)*;
- SetContentsOfBNumbers ::= BNumber (COMMA BNumber)*;
-
- Operation ::= (ParamList LARROW)? Identifier
- (LPAR ParamList RPAR)?
- EQUAL ProgramLikeFormula;
-
- Identifier ::= IDENTIFIER;
-
- UpperCaseIdentifier ::= UPPERCASEIDENTIFIER;
-
Copied: trunk/examples/Bnf.mmtp (from rev 33, trunk/examples/Bnf.mtp)
===================================================================
--- trunk/examples/Bnf.mmtp (rev 0)
+++ trunk/examples/Bnf.mmtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -0,0 +1,42 @@
+MODULE Bnf
+
+SIGNATURE
+
+SKIP BLANKS;
+
+ARROW = "::=" ;
+VBAR = "|";
+RULE_NAME = "<" (['a'-'z','_'])+ ">" ;
+LITERAL = "'" CHAR "'"
+ | "\"" (CHAR)* "\"";
+BLANKS = (" " | "\t")+;
+EOL = (['\n', '\r'])+;
+
+ CHAR = ( (~['\"','\\','\n','\r'])
+ | ("\\"
+ ( ['n','t','b','r','f','\\','\"']
+ | ['0'-'7'] ( ['0'-'7'] )?
+ | ['0'-'3'] ['0'-'7'] ['0'-'7']
+ )
+ )
+ );
+
+AXIOM BNFGrammar;
+
+GRAMMAR
+
+BNFGrammar ::= (Rule)+;
+
+Rule ::= RuleName ARROW ExpressionList EOL;
+
+ExpressionList ::= (Expression (VBAR Expression)* );
+
+Expression ::= (Term)+;
+
+Term ::= RuleName
+ | Literal
+ ;
+
+RuleName ::= RULE_NAME;
+
+Literal ::= LITERAL;
Deleted: trunk/examples/Bnf.mtp
===================================================================
--- trunk/examples/Bnf.mtp 2007-12-06 15:05:20 UTC (rev 33)
+++ trunk/examples/Bnf.mtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -1,42 +0,0 @@
-MODULE Bnf
-
-SIGNATURE
-
-SKIP BLANKS;
-
-ARROW = "::=" ;
-VBAR = "|";
-RULE_NAME = "<" (['a'-'z','_'])+ ">" ;
-LITERAL = "'" CHAR "'"
- | "\"" (CHAR)* "\"";
-BLANKS = (" " | "\t")+;
-EOL = (['\n', '\r'])+;
-
- CHAR = ( (~['\"','\\','\n','\r'])
- | ("\\"
- ( ['n','t','b','r','f','\\','\"']
- | ['0'-'7'] ( ['0'-'7'] )?
- | ['0'-'3'] ['0'-'7'] ['0'-'7']
- )
- )
- );
-
-AXIOM BNFGrammar;
-
-GRAMMAR
-
-BNFGrammar ::= (Rule)+;
-
-Rule ::= RuleName ARROW ExpressionList EOL;
-
-ExpressionList ::= (Expression (VBAR Expression)* );
-
-Expression ::= (Term)+;
-
-Term ::= RuleName
- | Literal
- ;
-
-RuleName ::= RULE_NAME;
-
-Literal ::= LITERAL;
Copied: trunk/examples/C.mmtp (from rev 33, trunk/examples/C.mtp)
===================================================================
--- trunk/examples/C.mmtp (rev 0)
+++ trunk/examples/C.mmtp 2007-12-06 15:21:40 UTC (rev 34)
@@ -0,0 +1,620 @@
+MODULE C
+
+SIGNATURE
+
+ IDENTIFIER = ( ["A"-"Z"] | ["a"-"z"] )
+ ( ["A"-"Z"] | ["a"-"z"] | ["0"-"9"] )* ;
+ SIZEOF = "sizeof";
+ PTR_OP = "->";
+ INC_OP = "++";
+ DEC_OP =...
[truncated message content] |
|
From: <ido...@us...> - 2007-12-06 15:36:22
|
Revision: 35
http://mtp.svn.sourceforge.net/mtp/?rev=35&view=rev
Author: idominguez
Date: 2007-12-06 07:36:12 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
JavaCC added to this repository. Note that JavaCC's license
is BSD, not GPL
Modified Paths:
--------------
trunk/INSTALL
trunk/src/mtp/parser/build.xml
Added Paths:
-----------
trunk/lib/javacc.jar
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2007-12-06 15:21:40 UTC (rev 34)
+++ trunk/INSTALL 2007-12-06 15:36:12 UTC (rev 35)
@@ -22,15 +22,9 @@
2. Compiling MMTP
================
-To build MMTP we are currently using Apache Ant. As Ant can't find the
-JavaCC libraries by itself, you need the environment variable JAVACC
-to point to the JavaCC lib directory. This location must have the javacc.jar
-file inside.
+To build MMTP we are currently using Apache Ant. Compiling mtp should
+be as simple as typing:
-In most Debian systems, you must set JAVACC=/usr/share/java,
-in Gentoo systems, the correct value is JAVACC=/usr/share/javacc/lib.
-
-fons@escher:~/proyectos/mtp$ export JAVACC=/usr/share/java
fons@escher:~/proyectos/mtp$ ant
.....
Done build.
Added: trunk/lib/javacc.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/javacc.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/mtp/parser/build.xml
===================================================================
--- trunk/src/mtp/parser/build.xml 2007-12-06 15:21:40 UTC (rev 34)
+++ trunk/src/mtp/parser/build.xml 2007-12-06 15:36:12 UTC (rev 35)
@@ -8,30 +8,10 @@
<property file="build/common.properties" />
<property environment="env" />
-<!--
- We try to locate the javacc.jar home directory.
- In Ubuntu and other debian-based linux distributions,
- it is usually set to /usr/share/java.
- In other distributions it might not be the same.
-
-//-->
-<condition property="JAVACC" value="${env.JAVACC}" >
- <isset property="env.JAVACC" />
-</condition>
-<condition property="JAVACC" value="/usr/share/javacc/lib" >
- <and>
- <not> <isset property="${JAVACC}" /> </not>
- <contains string="${os.version}" substring="gentoo" />
- </and>
-</condition>
-<condition property="JAVACC" value="/usr/share/java" >
- <not> <isset property="${JAVACC}" /> </not>
-</condition>
-
<target name="compile-javacc"
description="compiles the source" >
<javacc target="${parser}/MtpParser.jj"
- javacchome="${JAVACC}"
+ javacchome="${lib}/"
outputdirectory="${parser}" />
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-06 15:53:17
|
Revision: 37
http://mtp.svn.sourceforge.net/mtp/?rev=37&view=rev
Author: idominguez
Date: 2007-12-06 07:51:33 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
dependencies added to lib/, checkstyle script fixed
Modified Paths:
--------------
trunk/bin/checkstyle
Added Paths:
-----------
trunk/lib/antlr.jar
trunk/lib/checkstyle.jar
trunk/lib/commons-beanutils.jar
trunk/lib/commons-logging.jar
Modified: trunk/bin/checkstyle
===================================================================
--- trunk/bin/checkstyle 2007-12-06 15:38:17 UTC (rev 36)
+++ trunk/bin/checkstyle 2007-12-06 15:51:33 UTC (rev 37)
@@ -1 +1 @@
-ant -lib /usr/share/java/checkstyle.jar:/usr/share/java/commons-beanutils.jar:/usr/share/java/commons-logging.jar:/usr/share/java/antlr.jar checkstyle
+ant -lib lib/checkstyle.jar:lib/commons-beanutils.jar:lib/commons-logging.jar:lib/antlr.jar checkstyle
Added: trunk/lib/antlr.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/antlr.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/checkstyle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/checkstyle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/commons-beanutils.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/commons-beanutils.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/commons-logging.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-09 04:32:42
|
Revision: 40
http://mtp.svn.sourceforge.net/mtp/?rev=40&view=rev
Author: idominguez
Date: 2007-12-08 20:32:38 -0800 (Sat, 08 Dec 2007)
Log Message:
-----------
New version 0.3.3 to be started
Modified Paths:
--------------
trunk/FEATURES-0.3
trunk/VERSION
Modified: trunk/FEATURES-0.3
===================================================================
--- trunk/FEATURES-0.3 2007-12-08 18:48:26 UTC (rev 39)
+++ trunk/FEATURES-0.3 2007-12-09 04:32:38 UTC (rev 40)
@@ -5,6 +5,8 @@
of MTP. A few features have been added to this
new version of MTP:
+0.3.3
+
0.3.2
- < and > are no longer needed for symbols (idominguez).
- All AST nodes include position fields, and
Modified: trunk/VERSION
===================================================================
--- trunk/VERSION 2007-12-08 18:48:26 UTC (rev 39)
+++ trunk/VERSION 2007-12-09 04:32:38 UTC (rev 40)
@@ -1 +1 @@
-0.3.2
+0.3.3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-09 14:37:41
|
Revision: 43
http://mtp.svn.sourceforge.net/mtp/?rev=43&view=rev
Author: idominguez
Date: 2007-12-09 06:37:18 -0800 (Sun, 09 Dec 2007)
Log Message:
-----------
i18n support
Modified Paths:
--------------
trunk/build.xml
trunk/src/mtp/analysis/StaticAnalyser.java
trunk/src/mtp/analysis/SymTabBuilder.java
trunk/src/mtp/mtp.java
Added Paths:
-----------
trunk/bin/extract_strings
trunk/resources/
trunk/resources/MTP.po
trunk/resources/translations/
trunk/resources/translations/es_ES/
trunk/resources/translations/es_ES/MTP.po
trunk/src/mtp/i18n/
trunk/src/mtp/i18n/I18N.java
Added: trunk/bin/extract_strings
===================================================================
--- trunk/bin/extract_strings (rev 0)
+++ trunk/bin/extract_strings 2007-12-09 14:37:18 UTC (rev 43)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+find src/mtp -iname *.java | xargs xgettext --keyword=_ -L java -p resources/ -d MTP --from-code=utf-8
Property changes on: trunk/bin/extract_strings
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2007-12-09 13:44:58 UTC (rev 42)
+++ trunk/build.xml 2007-12-09 14:37:18 UTC (rev 43)
@@ -46,6 +46,8 @@
<target name="compile" description="compiles the source">
<ant antfile="${mtp}/build.xml" target="compile-jar" />
+ <ant antfile="./build.xml" target="translation" />
+ <ant antfile="${mtp}/build.xml" target="compile-jar" />
<mtpscript />
</target>
@@ -130,25 +132,56 @@
<target name="install" depends="compile,configure-install,install-vim">
- <antcall target="install-vim" />
- <mkdir dir="${installroot}/lib" />
- <copy todir="${installroot}" overwrite="true">
- <fileset dir=".">
- <include name="${lib}/JSAP-2.1.jar" />
- <include name="${lib}/mtp.jar" />
- </fileset>
- </copy>
- <symlink action="single"
- link="${installroot}/lib/jsap.jar"
- resource="${installroot}/lib/JSAP-2.1.jar"
- overwrite="true" />
- <mkdir dir="${installroot}/bin" />
- <copy tofile="${installroot}/bin/mtp" overwrite="true" file="bin/mtp.sh" />
- <replace file="${installroot}/bin/mtp" token="$DEV_ROOT" value="${installroot}" />
- <chmod file="${installroot}/bin/mtp" perm="ugo+rx" />
- <symlink action="single"
- link="${installbinroot}/mtp"
- resource="${installroot}/bin/mtp"
- overwrite="true" />
+ <antcall target="install-vim" />
+ <mkdir dir="${installroot}/lib" />
+ <copy todir="${installroot}" overwrite="true">
+ <fileset dir=".">
+ <include name="${lib}/JSAP-2.1.jar" />
+ <include name="${lib}/mtp.jar" />
+ </fileset>
+ </copy>
+ <symlink action="single"
+ link="${installroot}/lib/jsap.jar"
+ resource="${installroot}/lib/JSAP-2.1.jar"
+ overwrite="true" />
+ <mkdir dir="${installroot}/bin" />
+ <copy tofile="${installroot}/bin/mtp" overwrite="true" file="bin/mtp.sh" />
+ <replace file="${installroot}/bin/mtp" token="$DEV_ROOT" value="${installroot}" />
+ <chmod file="${installroot}/bin/mtp" perm="ugo+rx" />
+ <symlink action="single"
+ link="${installbinroot}/mtp"
+ resource="${installroot}/bin/mtp"
+ overwrite="true" />
</target>
+
+<target name="translation">
+ <mtp-translation-generate-classes language="es_ES" />
+</target>
+
+<macrodef name="mtp-translation-generate-classes">
+ <attribute name="language" />
+ <sequential>
+ <translation-generate-classes language="@{language}" base="MTP" destdir="obj" resource="mtp.i18n.MTP" />
+ </sequential>
+</macrodef>
+
+<macrodef name="translation-generate-classes">
+ <attribute name="language" />
+ <attribute name="base" />
+ <attribute name="destdir" />
+ <attribute name="resource" />
+ <sequential>
+ <exec executable="msgfmt">
+ <arg value="--java2" />
+ <arg value="-d" />
+ <arg value="@{destdir}" />
+ <arg value="-r" />
+ <arg value="@{resource}" />
+ <arg value="-l" />
+ <arg value="@{language}" />
+ <arg value="resources/translations/@{language}/@{base}.po" />
+ </exec>
+ </sequential>
+</macrodef>
+
</project>
Added: trunk/resources/MTP.po
===================================================================
--- trunk/resources/MTP.po (rev 0)
+++ trunk/resources/MTP.po 2007-12-09 14:37:18 UTC (rev 43)
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-05 13:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL...@li...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/mtp/synthesis/Output.java:69
+msgid "The directory "
+msgstr ""
+
+#: src/mtp/synthesis/Output.java:70
+msgid " couldn't be created"
+msgstr ""
+
+#: src/mtp/backends/basic/GrammarModuleBackEnd.java:46
+#: src/mtp/backends/basic/GrammarModuleBackEnd.java:71
+#: src/mtp/backends/basic/GrammarModuleBackEnd.java:74
+msgid "mtpfile"
+msgstr ""
+
+#: src/mtp/analysis/SymTabBuilder.java:781
+msgid "According to the module name "
+msgstr ""
+
+#: src/mtp/analysis/SymTabBuilder.java:782
+msgid ", the file should be named "
+msgstr ""
+
+#: src/mtp/analysis/StaticAnalyser.java:111
+msgid "Starting static analysis"
+msgstr ""
Added: trunk/resources/translations/es_ES/MTP.po
===================================================================
--- trunk/resources/translations/es_ES/MTP.po (rev 0)
+++ trunk/resources/translations/es_ES/MTP.po 2007-12-09 14:37:18 UTC (rev 43)
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: MTP-0.3.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-05 13:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL...@li...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/mtp/synthesis/Output.java:69
+msgid "The directory "
+msgstr "El directorio "
+
+#: src/mtp/synthesis/Output.java:70
+msgid " couldn't be created"
+msgstr " no se ha podido crear"
+
+#: src/mtp/analysis/SymTabBuilder.java:781
+msgid "According to the module name "
+msgstr "De acuerdo con el nombre del módulo "
+
+#: src/mtp/analysis/SymTabBuilder.java:782
+msgid ", the file should be named "
+msgstr ", el fichero debería llamarse "
+
+#: src/mtp/analysis/StaticAnalyser.java:111
+msgid "Starting static analysis"
+msgstr "Comenzando análisis estático"
Modified: trunk/src/mtp/analysis/StaticAnalyser.java
===================================================================
--- trunk/src/mtp/analysis/StaticAnalyser.java 2007-12-09 13:44:58 UTC (rev 42)
+++ trunk/src/mtp/analysis/StaticAnalyser.java 2007-12-09 14:37:18 UTC (rev 43)
@@ -33,6 +33,7 @@
import mtp.log.Msg;
import mtp.log.Priority;
import mtp.semantics.*;
+import static mtp.i18n.I18N._;
/**
* Checks some semantic properties of an MTP {@link
@@ -43,8 +44,8 @@
* @author Jaime Nuche
* @author Hector Fuertes
* @author Ivan Perez
- * @version $Revision: 1180 $
- */
+ * @version $Revision: 988 $
+ **/
public class StaticAnalyser {
/**
* To report error and debug messages (log messages in general).
@@ -78,7 +79,7 @@
/**
* Default constructor <b>not allowed</b>
- */
+ **/
private StaticAnalyser()
{
// Unused constructor
@@ -89,7 +90,7 @@
*
* @param log the log object
* @param filename the file name int log messages
- */
+ **/
public StaticAnalyser (Log log,
String filename)
{
@@ -103,11 +104,11 @@
* mtp.semantics.Environment} environment.
*
* @param grammarModule the grammar module to be analysed
- */
+ **/
public void analyse (GrammarModule grammarModule)
{
this.log.report(new Msg(Priority.DEBUG,
- "Starting static analysis"));
+ _("Starting static analysis")));
// Building temporal symbol tables
this.symTabBuilder = new SymTabBuilder(this.log,this.filename);
@@ -136,7 +137,7 @@
/**
* Checks if all the defined symbols are used.
- */
+ **/
private void allSymbolsUsed ()
{
this.log.report(new Msg(Priority.DEBUG,
@@ -158,7 +159,7 @@
* expressions} and builds a symbol table with
* {@link * mtp.semantics.SemRegExp semantic regular expressions}
* in the {@link env environment}
- */
+ **/
private void analyseRegularExpressions ()
{
this.log.report(new Msg(Priority.DEBUG,
@@ -184,7 +185,7 @@
*
* @param tsSymbol the terminal symbol name
* @param expanded the set of the expanded terminal symbols
- */
+ **/
private SemRegExp analyseTerminal (Symbol tsSymbol,
Set<Symbol> expanded)
{
@@ -209,7 +210,7 @@
*
* @param regExp the regular expression to be kinded
* @param expanded the set of terminal symbol used in the definition
- */
+ **/
private SemRegExp.Kind analyseRegExp (RegExp regExp,
Set<Symbol> expanded)
{
@@ -246,7 +247,7 @@
* @param complexRegExp the complex regular expression to be
* kinded
* @param expanded the set of terminal symbol used in the definition
- */
+ **/
private SemRegExp.Kind analyseComplexRegExp
(ComplexRegExp complexRegExp,
Set<Symbol> expanded)
@@ -281,7 +282,7 @@
* kinded
* @param expanded the set of terminal symbol names used in
* the definition.
- */
+ **/
private SemRegExp.Kind analyseRegExpUnit (RegExpUnit regExpUnit,
Set<Symbol> expanded)
{
@@ -350,7 +351,7 @@
* Analyses static properties of {@link mtp.ast.Production
* productions} and adds semantic information to the {@link env
* environment}.
- */
+ **/
private void analyseProductions ()
{
this.log.report(new Msg(Priority.DEBUG,
@@ -371,7 +372,7 @@
* and ads semantic information to the {@link env environment}.
*
* @param ntsSymbol the non terminal symbol to be analysed
- */
+ **/
private void analyseProduction (Symbol ntsSymbol)
{
this.log.report(new Msg(Priority.DEBUG,
@@ -396,7 +397,7 @@
*
* @param ntsSymbol the non terminal symbol to be analysed
* @param classification the RHS in the production definition for ntsName
- */
+ **/
private void analyseClassification (Symbol ntsSymbol,
Classification classification)
{
@@ -449,7 +450,7 @@
*
* @param ntsSymbol the non terminal symbol to be analysed
* @param structure the right hand side of the production
- */
+ **/
private void analyseStructure (Symbol ntsSymbol,
Structure structure)
{
@@ -486,7 +487,7 @@
}
} else if (semLabConsSeq[i].label != null) {
labels.add (semLabConsSeq[i].label);
- } // else (label == null -> non-informative construct)
+ } // else (label = null -> non-informative construct)
}
this.env.structures.put(ntsSymbol, semLabConsSeq);
@@ -519,7 +520,7 @@
* labelled construct}.
*
* @param labelledConstruct the labelled construct
- */
+ **/
private SemLabelledConstruct semanticLabelledConstruct
(LabelledConstruct labelledConstruct)
{
@@ -533,36 +534,16 @@
semLabelledConstruct.label);
}
else {
- String userLabel =
- labelledConstruct.identifierOpt[0].terminalNode.image;
-
- // The label "_" indicates that the user doesn't want to save
- // the symbol in the AST node
- if (userLabel.compareTo("_") == 0) {
- semLabelledConstruct.label = null;
- }
- else {
- semLabelledConstruct.label = userLabel;
- }
+ semLabelledConstruct.label =
+ labelledConstruct.identifierOpt[0].terminalNode.image;
}
}
- else {
- if (labelledConstruct.identifierOpt.length > 0 &&
- semLabelledConstruct.poly == SemLabelledConstruct.Poly.CTE) {
- reportConstantTermianlLabelError
- (semLabelledConstruct.firstIdentifier(),
- labelledConstruct.identifierOpt[0].terminalNode.image);
- }
- }
return semLabelledConstruct;
}
- /**
- * Returns a {@link SemLabelledConstruct semantic labelled
- * construct} from a given {@link mtp.ast.Construct construct}.
+ /*
*
- * @param construct the construct
*/
private SemLabelledConstruct semanticLabelledConstruct (Construct construct)
{
@@ -618,7 +599,7 @@
* @param construct the construct node
*
* @return the significative label in the given construct node
- */
+ **/
private String getConstantTerminalLabel (Construct construct)
{
String label = null;
@@ -663,7 +644,7 @@
* @param construct the construct node
*
* @return the significative type in the given construct node
- */
+ **/
private String baseType (Construct construct)
{
String result = null;
@@ -739,14 +720,14 @@
* @param construct the construct node
*
* @return the polymorphic type of the given construct node
- */
+ **/
private SemLabelledConstruct.Poly poly (Construct construct)
{
SemLabelledConstruct.Poly result;
SemLabelledConstruct.Poly externType;
if (construct instanceof SimpleConstruct) {
- if (this.baseType(construct) == null) {
+ if (baseType(construct) == null) {
result = SemLabelledConstruct.Poly.CTE;
}
else {
@@ -846,7 +827,7 @@
* that stores an instance of the class.
*
* @param className the class name
- */
+ **/
private static String classToAttribute (String className)
{
if (className == null) {
@@ -862,7 +843,7 @@
*
* @param construct the construct
* @return the first identifier in the given construct.
- */
+ **/
private static Identifier firstIdentifier (Construct construct)
{
if (construct instanceof SimpleConstruct) {
@@ -897,7 +878,7 @@
* @param symbol a symbol
*
* @return the symbol name string
- */
+ **/
public static String getSymbolString (Symbol symbol)
{
if (symbol == null) {
@@ -922,7 +903,7 @@
* @param string a string
*
* @return the string with the first char in capital letter
- */
+ **/
public static String firstCharToUpper (String string) {
if (string != null) {
String sub = string.substring(0, 1);
@@ -940,7 +921,7 @@
* @param string a string
*
* @return the string with the first char in small letter
- */
+ **/
public static String firstCharToLower (String string) {
if (string != null) {
String sub = string.substring (0, 1);
@@ -956,7 +937,7 @@
* Reports errors about undefined symbols names.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportUndefSymbolErr (Identifier id)
{
int line = id.terminalNode.beginLine;
@@ -970,7 +951,7 @@
* Reports errors about recursive terminal symbol use.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportCircularRegExpErr (Identifier id)
{
int line = id.terminalNode.beginLine;
@@ -988,7 +969,7 @@
* expressions.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportNonTerminalNotAllowedErr (Identifier id)
{
int line = id.terminalNode.beginLine;
@@ -1004,7 +985,7 @@
* Reports warnings about unused symbols names.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportUnusedSymbolWarn (Symbol symbol)
{
int line = symbol.symbolId.terminalNode.beginLine;
@@ -1019,7 +1000,7 @@
* productions.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportTerminalInClassificationErr (Identifier id)
{
int line = id.terminalNode.beginLine;
@@ -1037,7 +1018,7 @@
* production.
*
* @param id the identifier containing the symbol name
- */
+ **/
private void reportCircularClassificationErr (Identifier id)
{
int line = id.terminalNode.beginLine;
@@ -1052,7 +1033,7 @@
/**
* Reports errors about the semantic restriction in production RHS.
- */
+ **/
private void reportSemanticRestrictionErr (Identifier id,
String tyName1,
String tyName2)
@@ -1072,7 +1053,7 @@
/**
* Reports warning about unlabelled constructs automatically labelled
- */
+ **/
private void reportAutomaticLabelWarn (Identifier id,
String label)
{
@@ -1087,24 +1068,8 @@
}
/**
- * Reports error about constant terminal symbols labelled by the user
- */
- private void reportConstantTermianlLabelError (Identifier id,
- String label)
- {
- int line = id.terminalNode.beginLine;
- int column = id.terminalNode.beginColumn;
- String msg =
- "Constant lexeme terminal symbol (\""
- + label
- + "\") cannot be labelled.";
-
- log.report (new Msg(Priority.ERROR, msg, filename, line, column));
- }
-
- /**
* Reports errors about duplicated labels in right hand side.
- */
+ **/
private void reportDuplicatedLabelErr (Symbol symbol,
String label)
{
Modified: trunk/src/mtp/analysis/SymTabBuilder.java
===================================================================
--- trunk/src/mtp/analysis/SymTabBuilder.java 2007-12-09 13:44:58 UTC (rev 42)
+++ trunk/src/mtp/analysis/SymTabBuilder.java 2007-12-09 14:37:18 UTC (rev 43)
@@ -30,6 +30,7 @@
import mtp.ast.*;
import mtp.log.*;
+import static mtp.i18n.I18N._;
/**
* Builds several symbol tables by visiting a {@link
@@ -777,8 +778,8 @@
int line,
int column)
{
- String msg = "According to the module name " + moduleName +
- ", " + "the file should be named " + moduleName + ".mmtp";
+ String msg = _("According to the module name ") + moduleName +
+ ", " + _("the file should be named ") + moduleName + ".mmtp";
log.report(new Msg (Priority.WARN, msg,
this.filename, line, column));
Added: trunk/src/mtp/i18n/I18N.java
===================================================================
--- trunk/src/mtp/i18n/I18N.java (rev 0)
+++ trunk/src/mtp/i18n/I18N.java 2007-12-09 14:37:18 UTC (rev 43)
@@ -0,0 +1,40 @@
+package mtp.i18n;
+
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
+
+public class I18N
+{
+ private static ResourceBundle catalog = get();
+
+ public static final String _(String s)
+ {
+ if (catalog == null)
+ {
+ return s;
+ }
+ else
+ {
+ try
+ {
+ return catalog.getString(s);
+ }
+ catch (MissingResourceException e)
+ {
+ return s;
+ }
+ }
+ }
+
+ private static ResourceBundle get ()
+ {
+ try
+ {
+ return ResourceBundle.getBundle("mtp.i18n.MTP");
+ }
+ catch (MissingResourceException e)
+ {
+ return null;
+ }
+ }
+}
Modified: trunk/src/mtp/mtp.java
===================================================================
--- trunk/src/mtp/mtp.java 2007-12-09 13:44:58 UTC (rev 42)
+++ trunk/src/mtp/mtp.java 2007-12-09 14:37:18 UTC (rev 43)
@@ -138,8 +138,8 @@
mng.execute(parseCmdLine(jsap, args)) ;
System.exit(0);
- } catch (BackEndException e) {
- System.exit(1);
+ //} catch (BackEndException e) {
+ // System.exit(1);
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(2);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ido...@us...> - 2007-12-16 01:20:12
|
Revision: 45
http://mtp.svn.sourceforge.net/mtp/?rev=45&view=rev
Author: idominguez
Date: 2007-12-15 17:18:33 -0800 (Sat, 15 Dec 2007)
Log Message:
-----------
checkstyle correctly included in the classpath
Modified Paths:
--------------
trunk/README
trunk/build.xml
Removed Paths:
-------------
trunk/bin/checkstyle
Modified: trunk/README
===================================================================
--- trunk/README 2007-12-09 14:39:59 UTC (rev 44)
+++ trunk/README 2007-12-16 01:18:33 UTC (rev 45)
@@ -73,5 +73,5 @@
Note that we try to follow some coding standards, although part of the old code
doesn't follow those at all. If you are going to submit a patch, please try to
use those standards in your new code. You can check your code with
-"bin/checkstyle", and the list of enabled options for it is detailed in
+"ant checkstyle", and the list of enabled options for it is detailed in
"build/sun_checks.xml"
Deleted: trunk/bin/checkstyle
===================================================================
--- trunk/bin/checkstyle 2007-12-09 14:39:59 UTC (rev 44)
+++ trunk/bin/checkstyle 2007-12-16 01:18:33 UTC (rev 45)
@@ -1 +0,0 @@
-ant -lib lib/checkstyle.jar:lib/commons-beanutils.jar:lib/commons-logging.jar:lib/antlr.jar checkstyle
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2007-12-09 14:39:59 UTC (rev 44)
+++ trunk/build.xml 2007-12-16 01:18:33 UTC (rev 45)
@@ -31,7 +31,11 @@
</javadoc>
</target>
-<taskdef resource="checkstyletask.properties" />
+<taskdef resource="checkstyletask.properties">
+ <classpath>
+ <fileset dir="lib/" includes="*.jar" />
+ </classpath>
+</taskdef>
<target name="checkstyle" description="Checks the style of the code">
<checkstyle config="build/sun_checks.xml" >
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|