Permalink
Browse files

Remove all transitionary pieces and puts everything in the right place

  • Loading branch information...
1 parent b2d6cf6 commit bd7fd7589fb1e9316797b4620db065305a2c71be @olabini committed Jul 23, 2009
View
@@ -41,11 +41,6 @@
</exec>
<exec executable="re2j" failonerror="true">
- <arg line="-o ${main.src.dir}/org/yecht/TokenScanner2.java"/>
- <arg line="${main.src.dir}/org/yecht/TokenScanner2.re"/>
- </exec>
-
- <exec executable="re2j" failonerror="true">
<arg line="-o ${main.src.dir}/org/yecht/ImplicitScanner.java"/>
<arg line="${main.src.dir}/org/yecht/ImplicitScanner.re"/>
</exec>
@@ -63,12 +58,6 @@
</exec>
</target>
- <target name="jacc" depends="prepare" description="Standalone target that generates all our jacc based source files.">
- <java jar="lib/jacc.jar" fork="true">
- <arg line="${main.src.dir}/org/yecht/YAMLGrammar.jacc"/>
- </java>
- </target>
-
<target name="compile" depends="prepare" description="Compile the source files for the project.">
<javac destdir="${yecht.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}">
<classpath refid="build.classpath"/>
@@ -77,7 +66,7 @@
</javac>
</target>
- <target name="compile-with-gen" depends="re2j, jacc, jay" description="Compile the source files for the project.">
+ <target name="compile-with-gen" depends="re2j, jay" description="Compile the source files for the project.">
<javac destdir="${yecht.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}">
<classpath refid="build.classpath"/>
<src path="${main.src.dir}"/>
@@ -159,6 +148,6 @@
<delete file="-o ${main.src.dir}/org/yecht/TokenScanner.java" quiet="true"/>
<delete file="-o ${main.src.dir}/org/yecht/ImplicitScanner.java" quiet="true"/>
<delete file="-o ${main.src.dir}/org/yecht/BytecodeScanner.java" quiet="true"/>
- <delete file="-o ${main.src.dir}/org/yecht/YechtParser.java" quiet="true"/>
+ <delete file="-o ${main.src.dir}/org/yecht/DefaultYAMLParser.java" quiet="true"/>
</target>
</project>
View
Binary file not shown.
@@ -1,10 +1,10 @@
-/* Generated by re2j 0.13.6.dev on Thu Jul 23 17:15:02 2009 */
+/* Generated by re2j 0.13.6.dev on Thu Jul 23 17:24:15 2009 */
package org.yecht;
import java.io.IOException;
// Equivalent to bytecode.re
-public class BytecodeScanner implements YAMLGrammarTokens, Scanner {
+public class BytecodeScanner implements DefaultYAMLParser.yyInput {
public final static int QUOTELEN = 128;
private Parser parser;
@@ -13,24 +13,19 @@
public BytecodeScanner(Parser parser) {
this.parser = parser;
- yylex();
}
- public Object getLVal() {
+ public Object value() {
return lval;
}
- public int currentToken() {
+ public int token() {
return currentToken;
}
- public int yylex() {
- try {
- currentToken = real_yylex();
- return currentToken;
- } catch(java.io.IOException ioe) {
- throw new RuntimeException(ioe);
- }
+ public boolean advance() throws java.io.IOException {
+ currentToken = real_yylex();
+ return currentToken == 0 ? false : true;
}
private void YYPOS(int n) {
@@ -166,7 +161,7 @@ private int real_yylex() throws IOException {
if(lvl.spaces > -1) {
parser.popLevel();
YYPOS(0);
- return YAML_IEND;
+ return DefaultYAMLParser.YAML_IEND;
}
YYPOS(0);
return 0;
@@ -271,7 +266,7 @@ private int real_yylex() throws IOException {
lval = getInline();
parser.removeAnchor((String)lval);
CHK_NL(parser.cursor);
- return YAML_ANCHOR;
+ return DefaultYAMLParser.YAML_ANCHOR;
}
case 21:
++parser.cursor;
@@ -281,7 +276,7 @@ private int real_yylex() throws IOException {
lval = getInline();
parser.popLevel();
if( parser.buffer.buffer[parser.cursor - 1] == '\n') parser.cursor--;
- return YAML_ALIAS;
+ return DefaultYAMLParser.YAML_ALIAS;
}
case 23:
++parser.cursor;
@@ -294,7 +289,7 @@ private int real_yylex() throws IOException {
if(qstr.charAt(0) == '!' ) {
int qidx = qstr.length();
if(qidx == 1) {
- return YAML_ITRANSFER;
+ return DefaultYAMLParser.YAML_ITRANSFER;
}
lvl = parser.currentLevel();
@@ -313,10 +308,10 @@ private int real_yylex() throws IOException {
lval = qstr.substring(1);
}
}
- return YAML_TRANSFER;
+ return DefaultYAMLParser.YAML_TRANSFER;
}
lval = qstr;
- return YAML_TAGURI;
+ return DefaultYAMLParser.YAML_TAGURI;
}
case 25:
++parser.cursor;
@@ -325,10 +320,10 @@ private int real_yylex() throws IOException {
++parser.cursor;
{ CHK_NL(parser.cursor);
if(lvl.status == LevelStatus.seq) {
- return YAML_INDENT;
+ return DefaultYAMLParser.YAML_INDENT;
} else if(lvl.status == LevelStatus.map) {
if(lvl.ncount % 2 == 1) return ':';
- else return YAML_INDENT;
+ else return DefaultYAMLParser.YAML_INDENT;
}
mainLoopGoto = Document; break gotoSomething;
}
@@ -343,7 +338,7 @@ private int real_yylex() throws IOException {
{ if(lvl.spaces > -1) {
parser.popLevel();
YYPOS(0);
- return YAML_IEND;
+ return DefaultYAMLParser.YAML_IEND;
}
YYPOS(0);
return 0;
@@ -364,16 +359,16 @@ private int real_yylex() throws IOException {
parser.popLevel();
lvl = parser.currentLevel();
if(lvl.status == LevelStatus.seq) {
- FORCE_NEXT_TOKEN(YAML_INDENT);
+ FORCE_NEXT_TOKEN(DefaultYAMLParser.YAML_INDENT);
} else if(lvl.status == LevelStatus.map) {
if(lvl.ncount % 2 == 1) {
FORCE_NEXT_TOKEN(':');
} else {
- FORCE_NEXT_TOKEN(YAML_INDENT);
+ FORCE_NEXT_TOKEN(DefaultYAMLParser.YAML_INDENT);
}
}
CHK_NL(parser.cursor);
- return YAML_IEND;
+ return DefaultYAMLParser.YAML_IEND;
}
case 34:
yych = parser.buffer.buffer[++parser.cursor];
@@ -392,10 +387,10 @@ private int real_yylex() throws IOException {
}
CHK_NL(parser.cursor);
if(complex) {
- FORCE_NEXT_TOKEN( YAML_IOPEN );
+ FORCE_NEXT_TOKEN( DefaultYAMLParser.YAML_IOPEN );
return '?';
}
- return YAML_IOPEN;
+ return DefaultYAMLParser.YAML_IOPEN;
}
case 37:
yych = parser.buffer.buffer[++parser.cursor];
@@ -414,10 +409,10 @@ private int real_yylex() throws IOException {
}
CHK_NL(parser.cursor);
if(complex) {
- FORCE_NEXT_TOKEN( YAML_IOPEN );
+ FORCE_NEXT_TOKEN( DefaultYAMLParser.YAML_IOPEN );
return '?';
}
- return YAML_IOPEN;
+ return DefaultYAMLParser.YAML_IOPEN;
}
case 40:
yych = parser.buffer.buffer[++parser.cursor];
@@ -430,7 +425,7 @@ private int real_yylex() throws IOException {
{ if(lvl.spaces > -1) {
parser.popLevel();
YYPOS(0);
- return YAML_IEND;
+ return DefaultYAMLParser.YAML_IEND;
}
YYPOS(0);
return 0;
@@ -554,7 +549,7 @@ private int real_yylex() throws IOException {
}
case 49:
{ parser.cursor = parser.token;
- return YAML_DOCSEP;
+ return DefaultYAMLParser.YAML_DOCSEP;
}
case 50:
yych = parser.buffer.buffer[++parser.cursor];
@@ -979,7 +974,7 @@ private int real_yylex() throws IOException {
if(parser.implicit_typing) {
ImplicitScanner.tryTagImplicit(n, parser.taguri_expansion);
}
- return YAML_PLAIN;
+ return DefaultYAMLParser.YAML_PLAIN;
}
}
}
Oops, something went wrong.

0 comments on commit bd7fd75

Please sign in to comment.