pier 2004/04/19 10:56:47
Modified:
src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser
JavaCharStream.java ParseException.java Parser.java
ParserConstants.java ParserTokenManager.java
Token.java TokenMgrError.java
src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer
AbstractSerializer.java
Log:
Garbage serializers are now Cocoon serializers (thanks to Jeremy to spotting
the XALAN incompliancies on HTML generation).
Revision Changes Path
1.3 +5 -4
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/JavaCharStream.java
Index: JavaCharStream.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/JavaCharStream.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JavaCharStream.java 5 Mar 2004 10:07:22 -0000 1.2
+++ JavaCharStream.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version
3.0 */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -512,7 +513,7 @@
}
/**
- * Method to adjust line and column numbers for the start of a token.<BR>
+ * Method to adjust line and column numbers for the start of a token.
*/
public void adjustBeginLineColumn(int newLine, int newCol)
{
1.3 +4 -3
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParseException.java
Index: ParseException.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParseException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParseException.java 5 Mar 2004 10:07:22 -0000 1.2
+++ ParseException.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version
3.0 */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.3 +25 -8
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/Parser.java
Index: Parser.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/Parser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Parser.java 5 Mar 2004 10:07:22 -0000 1.2
+++ Parser.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. Parser.java */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,8 +23,24 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
+import java.util.Iterator;
+
+import org.apache.garbage.tree.Attribute;
+import org.apache.garbage.tree.CData;
+import org.apache.garbage.tree.Characters;
+import org.apache.garbage.tree.Comment;
+import org.apache.garbage.tree.DocType;
+import org.apache.garbage.tree.ElementEnd;
+import org.apache.garbage.tree.ElementStart;
+import org.apache.garbage.tree.Events;
+import org.apache.garbage.tree.Expression;
+import org.apache.garbage.tree.ProcessingInstruction;
+import org.apache.garbage.tree.TemplateFor;
+import org.apache.garbage.tree.TemplateIf;
+import org.apache.garbage.tree.TemplateVar;
+import org.apache.garbage.tree.Tree;
+import org.apache.garbage.tree.TreeException;
-import org.apache.garbage.tree.*;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
@@ -48,7 +65,7 @@
* several times (the parser will automatically re-initialize its state once
the
* method is invoked).
* </p>
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Pier Fumagalli</a>, February
2003
*/
public class Parser implements Locator, ParserTables, ParserConstants {
@@ -159,7 +176,7 @@
* @param kind An array of integers specifying the possible kind
* of the next returned token.
* @return The next available token with the correct kind.
- * @throws ParseException If the token kind doesn't match one of
+ * @throws ParseException If the token kind doesn't match one of
* those specified.
*/
final public Token getNextToken(int kind[])
@@ -173,7 +190,7 @@
}
int expected[][] = new int[kind.length][1];
for (int x = 0; x < kind.length; x++) expected[x][0] = kind[x];
- throw new ParseException(prev_token, expected, tokenImage);
+ throw new ParseException(prev_token, expected, this.tokenImage);
}
/**
@@ -197,7 +214,7 @@
* of the next returned token.
* @param state The state in which the next token should be matched.
* @return The next available token with the correct kind.
- * @throws ParseException If the token kind doesn't match one of
+ * @throws ParseException If the token kind doesn't match one of
* those specified.
*/
final public Token getNextToken(int kind[], int state)
1.3 +4 -3
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParserConstants.java
Index: ParserConstants.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParserConstants.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParserConstants.java 5 Mar 2004 10:07:22 -0000 1.2
+++ ParserConstants.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. ParserConstants.java */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.3 +30 -3
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParserTokenManager.java
Index: ParserTokenManager.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/ParserTokenManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParserTokenManager.java 5 Mar 2004 10:07:22 -0000 1.2
+++ ParserTokenManager.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. ParserTokenManager.java */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,6 +16,32 @@
*/
package org.apache.garbage.parser;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+import java.util.Iterator;
+import org.apache.garbage.tree.Attribute;
+import org.apache.garbage.tree.CData;
+import org.apache.garbage.tree.Characters;
+import org.apache.garbage.tree.Comment;
+import org.apache.garbage.tree.DocType;
+import org.apache.garbage.tree.ElementEnd;
+import org.apache.garbage.tree.ElementStart;
+import org.apache.garbage.tree.Events;
+import org.apache.garbage.tree.Expression;
+import org.apache.garbage.tree.ProcessingInstruction;
+import org.apache.garbage.tree.TemplateFor;
+import org.apache.garbage.tree.TemplateIf;
+import org.apache.garbage.tree.TemplateVar;
+import org.apache.garbage.tree.Tree;
+import org.apache.garbage.tree.TreeException;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
public class ParserTokenManager implements ParserConstants
{
1.3 +4 -3
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/Token.java
Index: Token.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/Token.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Token.java 5 Mar 2004 10:07:22 -0000 1.2
+++ Token.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.3 +4 -3
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/TokenMgrError.java
Index: TokenMgrError.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/parser/TokenMgrError.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TokenMgrError.java 5 Mar 2004 10:07:22 -0000 1.2
+++ TokenMgrError.java 19 Apr 2004 17:56:46 -0000 1.3
@@ -1,12 +1,13 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version
3.0 */
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.4 +17 -2
cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer/AbstractSerializer.java
Index: AbstractSerializer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer/AbstractSerializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractSerializer.java 24 Mar 2004 02:28:22 -0000 1.3
+++ AbstractSerializer.java 19 Apr 2004 17:56:47 -0000 1.4
@@ -35,7 +35,8 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Pier Fumagalli</a>, February
2003
* @version CVS $Id$
*/
-public abstract class AbstractSerializer implements Serializer, Locator {
+public abstract class AbstractSerializer
+implements Serializer, Locator, org.apache.cocoon.serialization.Serializer {
/** The line separator string */
private static final char S_EOL[] =
@@ -91,6 +92,20 @@
public AbstractSerializer() {
super();
this.reset();
+ }
+
+ /*
====================================================================== */
+
+ public String getMimeType() {
+ return(this.getContentType());
+ }
+
+ public void setOutputStream(OutputStream out) {
+ this.setOutput(out);
+ }
+
+ public boolean shouldSetContentLength() {
+ return(false);
}
/*
====================================================================== */