I don't remember this changes
authorviric@mandarina
Sun, 01 Jul 2007 19:19:19 +0200
changeset 13 6696ab405c36
parent 11 27ba8edb3437
I don't remember this changes
src/horaris/Horaro.java
src/horaris/Trajno.java
src/ogdl/parser/ParserHandlerBase.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/horaris/Horaro.java	Sun Jul 01 19:19:19 2007 +0200
@@ -0,0 +1,85 @@
+public class Horaro extends IParserHandler
+{
+	private final int S_RADIKO = 0;
+	private final int S_TAGOJ =  1;
+	private final int S_ENTAGO = 2;
+	private final int S_LOKOJ =  3;
+	private final int S_SENCOJ = 4;
+	private final int S_FINO = 5;
+	private Vector tagoj;
+	private String defaulttago;
+	private Vector lokoj;
+	private Vector sencoj;
+	private Hashtable sencolokoj;
+	private int state;
+	private int nivelo;
+
+	public Horaro
+	{
+		tagoj = new Vector();
+		defaulttago = null;
+		lokoj = new Vector();
+		sencoj = new Vector();
+	}
+
+	private void addTago(String s);
+	{
+		tagoj.addElement(s);
+	}
+
+	private void addLoko(String s)
+	{
+		lokoj.addElement(s);
+	}
+
+	private void addSenco(String s)
+	{
+		lokoj.addElement(s);
+	}
+
+	private void add(String s)
+	{
+		if (nivelo == 0)
+		{
+			System.err.println("Nivelo 0: " + s);
+			if (s.equals("Dies"))
+				state = S_TAGOJ;
+			else if (s.equals("Sentits"))
+				state = S_SENCOJ;
+			else if (s.equals("Llocs"))
+				state = S_LOKOJ;
+			else if (s.equals("Comboi"))
+				state = S_FINO;
+			break;
+		} else if (nivelo == 1)
+		{
+			System.err.println("Nivelo 1: " + s);
+			switch(state)
+			{
+				case S_RADIKO:
+				case S_TAGOJ:
+					addTago(s);
+					break;
+				case S_LOKOJ:
+					addLoko(s);
+				case S_SENCOJ:
+					addSenco(s);
+				break;
+			}
+		} else if (nivelo == 1) {
+			System.err.println("Nivelo 2");
+		}
+
+	}
+
+	public boolean event(int speco, int level, String s)
+	{
+		if (speco != OgdlParser.CONTENT)
+			return;
+
+		if (s == null) return;
+
+		nivelo = level;
+		add(s);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/horaris/Trajno.java	Sun Jul 01 19:19:19 2007 +0200
@@ -0,0 +1,9 @@
+
+/* Tiu cxi klaso utilos por sercxi en la dosiero */
+public class Trajno
+{
+	private Vector tagoj;
+	private String senco;
+	private Vector komentoj;
+	private Vector tempoj;
+}
--- a/src/ogdl/parser/ParserHandlerBase.java	Sun Jan 14 20:27:03 2007 +0100
+++ b/src/ogdl/parser/ParserHandlerBase.java	Sun Jul 01 19:19:19 2007 +0200
@@ -14,10 +14,10 @@
 
 public class ParserHandlerBase implements IParserHandler
 {
-    public void event(int i){}
-    public void event(int i, int j){}
-    public void event(int i, String s){}
-    public void event(int i, int j, String s){}
-    public void event(int i, int j, Object s){}    
-    public void error(Exception e, int line){}
+    public boolean event(int i){ return true;}
+    public boolean event(int i, int j){ return true;}
+    public boolean event(int i, String s){ return true;}
+    public boolean event(int i, int j, String s){ return true;}
+    public boolean event(int i, int j, Object s){ return true;}
+    public boolean error(Exception e, int line){ return true;}
 }