Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Overbey2009-02-18 00:49:58 +0000
committerJeffrey Overbey2009-02-18 00:49:58 +0000
commit9f35cce7a260a5c30ff8b4fdc13fa7583819e1f4 (patch)
tree2ec22a0e74b62d7513ccb9b11fe47daf823c71fb
parent43cd70b67a65c7559513e0c0ef07abf5b71b94c6 (diff)
downloadorg.eclipse.photran-9f35cce7a260a5c30ff8b4fdc13fa7583819e1f4.tar.gz
org.eclipse.photran-9f35cce7a260a5c30ff8b4fdc13fa7583819e1f4.tar.xz
org.eclipse.photran-9f35cce7a260a5c30ff8b4fdc13fa7583819e1f4.zip
Fortran 2003 semantics and parser bug fixes
-rw-r--r--org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/ASTTypeParamDefStmtNode.java8
-rw-r--r--org.eclipse.photran.core/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java15
2 files changed, 15 insertions, 8 deletions
diff --git a/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/ASTTypeParamDefStmtNode.java b/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/ASTTypeParamDefStmtNode.java
index b5153976..62330ba6 100644
--- a/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/ASTTypeParamDefStmtNode.java
+++ b/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/ASTTypeParamDefStmtNode.java
@@ -32,7 +32,7 @@ public class ASTTypeParamDefStmtNode extends ASTNode
ASTTypeParamAttrSpecNode typeParamAttrSpec; // in ASTTypeParamDefStmtNode
org.eclipse.photran.internal.core.lexer.Token hiddenTColon; // in ASTTypeParamDefStmtNode
org.eclipse.photran.internal.core.lexer.Token hiddenTColon2; // in ASTTypeParamDefStmtNode
- ASTTypeParamDeclListNode typeParamDeclList; // in ASTTypeParamDefStmtNode
+ IASTListNode<ASTTypeParamDeclNode> typeParamDeclList; // in ASTTypeParamDefStmtNode
org.eclipse.photran.internal.core.lexer.Token hiddenTEos; // in ASTTypeParamDefStmtNode
public org.eclipse.photran.internal.core.lexer.Token getLabel()
@@ -68,12 +68,12 @@ public class ASTTypeParamDefStmtNode extends ASTNode
}
- public ASTTypeParamDeclListNode getTypeParamDeclList()
+ public IASTListNode<ASTTypeParamDeclNode> getTypeParamDeclList()
{
return this.typeParamDeclList;
}
- public void setTypeParamDeclList(ASTTypeParamDeclListNode newValue)
+ public void setTypeParamDeclList(IASTListNode<ASTTypeParamDeclNode> newValue)
{
this.typeParamDeclList = newValue;
}
@@ -116,7 +116,7 @@ public class ASTTypeParamDefStmtNode extends ASTNode
case 3: this.typeParamAttrSpec = (ASTTypeParamAttrSpecNode)value; return;
case 4: this.hiddenTColon = (org.eclipse.photran.internal.core.lexer.Token)value; return;
case 5: this.hiddenTColon2 = (org.eclipse.photran.internal.core.lexer.Token)value; return;
- case 6: this.typeParamDeclList = (ASTTypeParamDeclListNode)value; return;
+ case 6: this.typeParamDeclList = (IASTListNode<ASTTypeParamDeclNode>)value; return;
case 7: this.hiddenTEos = (org.eclipse.photran.internal.core.lexer.Token)value; return;
default: throw new IllegalArgumentException("Invalid index");
}
diff --git a/org.eclipse.photran.core/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java b/org.eclipse.photran.core/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
index a2dd5059..5891c0bc 100644
--- a/org.eclipse.photran.core/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
+++ b/org.eclipse.photran.core/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
@@ -1075,10 +1075,10 @@ public class FreeFormLexerPhase2 implements ILexer
*/
private final class MustBePrecededByOneOf extends Rule
{
- Terminal possibility1 = ALWAYS_RETURN_TRUE,
- possibility2 = ALWAYS_RETURN_TRUE,
- possibility3 = ALWAYS_RETURN_TRUE,
- possibility4 = ALWAYS_RETURN_TRUE;
+ Terminal possibility1 = ALWAYS_RETURN_FALSE,
+ possibility2 = ALWAYS_RETURN_FALSE,
+ possibility3 = ALWAYS_RETURN_FALSE,
+ possibility4 = ALWAYS_RETURN_FALSE;
public MustBePrecededByOneOf(Terminal tokenTerminal1, Terminal tokenTerminal2)
{
@@ -1128,6 +1128,11 @@ public class FreeFormLexerPhase2 implements ILexer
* This is used when we need a reasonable default in some places...
*/
private final Terminal ALWAYS_RETURN_TRUE = new Terminal("always return true");
+
+ /**
+ * This is used when we need a reasonable default in some places...
+ */
+ private final Terminal ALWAYS_RETURN_FALSE = new Terminal("always return false");
private final class MustBeFollowedBy extends Rule
{
@@ -1366,6 +1371,8 @@ public class FreeFormLexerPhase2 implements ILexer
{
if (targetTerminal == ALWAYS_RETURN_TRUE) return true;
+ if (targetTerminal == ALWAYS_RETURN_FALSE) return false;
+
if (tokenPos < 0 || tokenPos >= tokenStream.size()) return false;
IToken actualToken = (tokenPos >= 0 && tokenPos <= tokenStream.size()

Back to the top