You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@locus.apache.org on 2000/12/05 06:05:54 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser Parser.java Parser.jj
geirm 00/12/04 21:05:54
Modified: src/java/org/apache/velocity/runtime/parser Parser.java
Parser.jj
Log:
Usual suspects.
Revision Changes Path
1.37 +12 -9 jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java
Index: Parser.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- Parser.java 2000/11/30 08:15:50 1.36
+++ Parser.java 2000/12/05 05:05:52 1.37
@@ -21,7 +21,7 @@
*
* @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: Parser.java,v 1.36 2000/11/30 08:15:50 jvanzyl Exp $
+ * @version $Id: Parser.java,v 1.37 2000/12/05 05:05:52 geirm Exp $
*/
public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
protected JJTParserState jjtree = new JJTParserState();/**
@@ -50,9 +50,10 @@
* method and re-initializing the lexer with
* the new stream that we want parsed.
*/
- public SimpleNode parse(InputStream stream) throws ParseException
+ public SimpleNode parse(InputStream stream, String strTemplateName ) throws ParseException
{
SimpleNode sn = null;
+
try
{
token_source.clearStateVars();
@@ -61,16 +62,18 @@
}
catch (ParseException pe)
{
- Runtime.error ("Parser Exception: " + StringUtils.stackTrace(pe));
+ Runtime.error ("Parser Exception: " + strTemplateName + " : " + StringUtils.stackTrace(pe));
throw new ParseException (pe.currentToken,
pe.expectedTokenSequences, pe.tokenImage);
}
catch (Exception e)
{
- Runtime.error ("Parser Error: " + StringUtils.stackTrace(e));
+ Runtime.error ("Parser Error: " + strTemplateName + " : " + StringUtils.stackTrace(e));
}
+
return sn;
}
+
/**
* This method sets the directives Hashtable
*/
@@ -2009,12 +2012,6 @@
return retval;
}
- final private boolean jj_3R_18() {
- if (jj_3R_21()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
final private boolean jj_3R_68() {
if (jj_3R_74()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -2634,6 +2631,12 @@
if (jj_3R_79()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
+ final private boolean jj_3R_18() {
+ if (jj_3R_21()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
1.35 +6 -3 jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jj
Index: Parser.jj
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jj,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Parser.jj 2000/11/30 08:15:50 1.34
+++ Parser.jj 2000/12/05 05:05:53 1.35
@@ -96,7 +96,7 @@
*
* @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: Parser.jj,v 1.34 2000/11/30 08:15:50 jvanzyl Exp $
+ * @version $Id: Parser.jj,v 1.35 2000/12/05 05:05:53 geirm Exp $
*/
public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants/*@egen*/
{/*@bgen(jjtree)*/
@@ -129,9 +129,10 @@
* method and re-initializing the lexer with
* the new stream that we want parsed.
*/
- public SimpleNode parse(InputStream stream) throws ParseException
+ public SimpleNode parse(InputStream stream, String strTemplateName ) throws ParseException
{
SimpleNode sn = null;
+
try
{
token_source.clearStateVars();
@@ -140,16 +141,18 @@
}
catch (ParseException pe)
{
- Runtime.error ("Parser Exception: " + StringUtils.stackTrace(pe));
+ Runtime.error ("Parser Exception: " + strTemplateName + " : " + StringUtils.stackTrace(pe));
throw new ParseException (pe.currentToken,
pe.expectedTokenSequences, pe.tokenImage);
}
catch (Exception e)
{
- Runtime.error ("Parser Error: " + StringUtils.stackTrace(e));
+ Runtime.error ("Parser Error: " + strTemplateName + " : " + StringUtils.stackTrace(e));
}
+
return sn;
}
+
/**
* This method sets the directives Hashtable
*/