From 455974c4cc273b65c0dbc97f1d0a03ffba24435c Mon Sep 17 00:00:00 2001 From: lempinen Date: Tue, 16 Mar 2010 12:44:06 +0000 Subject: [PATCH] updated expression parser .javas git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14970 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../expressionParser/ExpressionParser.java | 90 +++++++++++++------ .../ExpressionParserConstants.java | 12 +-- .../ExpressionParserTokenManager.java | 16 +--- 3 files changed, 67 insertions(+), 51 deletions(-) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java index dfdc4f93..704a4b85 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.java @@ -1,14 +1,4 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/* Generated By:JavaCC: Do not edit this line. ExpressionParser.java */ package org.simantics.sysdyn.expressionParser; import java.util.Set; @@ -34,6 +24,7 @@ public class ExpressionParser implements ExpressionParserConstants { references = new HashMap>(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 4: + case 6: case 8: case 20: case 27: @@ -84,6 +75,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void expression() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 4: + case 6: case 8: case 20: case 27: @@ -410,6 +402,11 @@ public class ExpressionParser implements ExpressionParserConstants { } jj_consume_token(9); break; + case 6: + jj_consume_token(6); + function_arguments(); + jj_consume_token(7); + break; case 41: jj_consume_token(41); break; @@ -457,6 +454,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(4); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 4: + case 6: case 8: case 14: case 20: @@ -527,6 +525,7 @@ public class ExpressionParser implements ExpressionParserConstants { final public void output_expression_list() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 4: + case 6: case 8: case 14: case 20: @@ -560,6 +559,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(13); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 4: + case 6: case 8: case 14: case 20: @@ -614,6 +614,16 @@ public class ExpressionParser implements ExpressionParserConstants { finally { jj_save(1, xla); } } + private boolean jj_3R_46() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_2()) { + jj_scanpos = xsp; + if (jj_3R_50()) return true; + } + return false; + } + private boolean jj_3_2() { if (jj_3R_11()) return true; Token xsp; @@ -636,7 +646,7 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_41() { + private boolean jj_3R_42() { if (jj_scan_token(4)) return true; return false; } @@ -656,7 +666,7 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_45() { + private boolean jj_3R_47() { if (jj_scan_token(10)) return true; return false; } @@ -667,11 +677,11 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_42() { + private boolean jj_3R_43() { if (jj_scan_token(IDENT)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_45()) jj_scanpos = xsp; + if (jj_3R_47()) jj_scanpos = xsp; return false; } @@ -689,26 +699,32 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_40() { + private boolean jj_3R_41() { if (jj_scan_token(36)) return true; return false; } + private boolean jj_3R_40() { + if (jj_scan_token(6)) return true; + if (jj_3R_46()) return true; + return false; + } + private boolean jj_3R_39() { if (jj_scan_token(8)) return true; - if (jj_3R_44()) return true; + if (jj_3R_45()) return true; return false; } private boolean jj_3R_36() { if (jj_3R_10()) return true; - if (jj_3R_41()) return true; + if (jj_3R_42()) return true; return false; } private boolean jj_3R_38() { if (jj_scan_token(4)) return true; - if (jj_3R_43()) return true; + if (jj_3R_44()) return true; if (jj_scan_token(5)) return true; return false; } @@ -718,13 +734,13 @@ public class ExpressionParser implements ExpressionParserConstants { xsp = jj_scanpos; if (jj_scan_token(35)) { jj_scanpos = xsp; - if (jj_3R_40()) return true; + if (jj_3R_41()) return true; } return false; } private boolean jj_3R_37() { - if (jj_3R_42()) return true; + if (jj_3R_43()) return true; return false; } @@ -749,6 +765,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_scanpos = xsp; if (jj_3R_39()) { jj_scanpos = xsp; + if (jj_3R_40()) { + jj_scanpos = xsp; if (jj_scan_token(41)) return true; } } @@ -759,6 +777,7 @@ public class ExpressionParser implements ExpressionParserConstants { } } } + } return false; } @@ -801,7 +820,7 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_47() { + private boolean jj_3R_49() { if (jj_scan_token(13)) return true; return false; } @@ -891,12 +910,12 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_46() { + private boolean jj_3R_48() { if (jj_3R_11()) return true; return false; } - private boolean jj_3R_44() { + private boolean jj_3R_45() { if (jj_3R_11()) return true; return false; } @@ -909,13 +928,13 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } - private boolean jj_3R_43() { + private boolean jj_3R_44() { Token xsp; xsp = jj_scanpos; - if (jj_3R_46()) jj_scanpos = xsp; + if (jj_3R_48()) jj_scanpos = xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_47()) { jj_scanpos = xsp; break; } + if (jj_3R_49()) { jj_scanpos = xsp; break; } } return false; } @@ -928,6 +947,11 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } + private boolean jj_3R_52() { + if (jj_scan_token(IDENT)) return true; + return false; + } + private boolean jj_3R_19() { if (jj_3R_21()) return true; Token xsp; @@ -938,6 +962,16 @@ public class ExpressionParser implements ExpressionParserConstants { return false; } + private boolean jj_3R_51() { + if (jj_3R_52()) return true; + return false; + } + + private boolean jj_3R_50() { + if (jj_3R_51()) return true; + return false; + } + private boolean jj_3R_17() { if (jj_3R_19()) return true; Token xsp; @@ -967,7 +1001,7 @@ public class ExpressionParser implements ExpressionParserConstants { jj_la1_init_1(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x20000,0x78104110,0x20000,0x78104110,0x800,0x800,0x40000,0x80000,0x100000,0x7e00000,0x7e00000,0x78000000,0x78000000,0x78000000,0x80000000,0x0,0x0,0x80000000,0x1000,0x0,0x110,0x400,0x400,0x78104110,0x2000,0x0,0x2000,0x78104110,0x2000,0x78104110,0x2000,}; + jj_la1_0 = new int[] {0x20000,0x78104150,0x20000,0x78104150,0x800,0x800,0x40000,0x80000,0x100000,0x7e00000,0x7e00000,0x78000000,0x78000000,0x78000000,0x80000000,0x0,0x0,0x80000000,0x1000,0x0,0x150,0x400,0x400,0x78104150,0x2000,0x0,0x2000,0x78104150,0x2000,0x78104150,0x2000,}; } private static void jj_la1_init_1() { jj_la1_1 = new int[] {0x0,0x78380,0x0,0x78380,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x18,0x18,0x7,0x0,0x70180,0x8200,0x0,0x0,0x78380,0x0,0x8000,0x0,0x78380,0x0,0x78380,0x0,}; diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserConstants.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserConstants.java index 8c97a048..c9f72592 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserConstants.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserConstants.java @@ -1,14 +1,4 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/* Generated By:JavaCC: Do not edit this line. ExpressionParserConstants.java */ package org.simantics.sysdyn.expressionParser; diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java index 092bf44d..0c0636c4 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParserTokenManager.java @@ -1,14 +1,4 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/* Generated By:JavaCC: Do not edit this line. ExpressionParserTokenManager.java */ package org.simantics.sysdyn.expressionParser; import java.util.Set; import java.util.HashSet; @@ -898,7 +888,9 @@ protected Token jjFillToken() beginColumn = input_stream.getBeginColumn(); endLine = input_stream.getEndLine(); endColumn = input_stream.getEndColumn(); - t = Token.newToken(jjmatchedKind, curTokenImage); + t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; + t.image = curTokenImage; t.beginLine = beginLine; t.endLine = endLine; -- 2.47.1