JavaPatternMatching/src/de/dhbwstuttgart/parser/Token.java

178 lines
3.9 KiB
Java
Raw Normal View History

2013-10-18 11:33:46 +00:00
// ino.module.Token.8619.package
package de.dhbwstuttgart.parser;
2013-10-18 11:33:46 +00:00
// ino.end
// ino.class.Token.24859.declaration
public class Token
// ino.end
// ino.class.Token.24859.body
{
// ino.attribute.token.24862.declaration
public Object token;
// ino.end
// ino.attribute.lexem.24865.declaration
private String lexem;
// ino.end
// ino.attribute.m_LineNumber.24868.declaration
private int m_LineNumber;
// ino.end
// ino.attribute.m_Offset.24871.declaration
private int m_Offset;//hinzugef<65>gt hoth: 14.04.2006
// ino.end
// ino.method.Token.24874.definition
Token (int tok, int lineNumber)
// ino.end
// ino.method.Token.24874.body
{
this.token = new Integer(tok);
m_LineNumber = lineNumber;
}
// ino.end
// ino.method.Token.24877.definition
Token (int tok, String s, int lineNumber)
// ino.end
// ino.method.Token.24877.body
{
lexem = s;
this.token = new Integer(tok);
m_LineNumber = lineNumber;
}
// ino.end
// ino.method.Token.24880.definition
Token (int tok, char c, int lineNumber)
// ino.end
// ino.method.Token.24880.body
{
char[] ch = new char[1];
ch[0] = c;
this.token = new String(ch);
m_LineNumber = lineNumber;
}
// ino.end
// ino.method.Token.24883.defdescription type=line
// hinzugef<65>gt hoth: 14.04.2006
// ino.end
// ino.method.Token.24883.definition
Token (int tok, String s, int lineNumber, int charOffset)
// ino.end
// ino.method.Token.24883.body
{
lexem = s;
this.token = new Integer(tok);
m_LineNumber = lineNumber;
m_Offset = charOffset;
}
// ino.end
// ino.method.Token.24886.defdescription type=line
// hinzugef<65>gt hoth: 14.04.2006
// ino.end
// ino.method.Token.24886.definition
Token (int tok, char c, int lineNumber, int charOffset)
// ino.end
// ino.method.Token.24886.body
{
char[] ch = new char[1];
ch[0] = c;
this.token = new String(ch);
m_LineNumber = lineNumber;
m_Offset = charOffset;
}
// ino.end
// ino.method.getLineNumber.24889.definition
public int getLineNumber()
// ino.end
// ino.method.getLineNumber.24889.body
{
return m_LineNumber;
}
// ino.end
// ino.method.getOffset.24892.definition
public int getOffset()
// ino.end
// ino.method.getOffset.24892.body
{
return m_Offset;
}
// ino.end
// ino.method.getLexem.24895.definition
public String getLexem ()
// ino.end
// ino.method.getLexem.24895.body
{
return lexem;
}
// ino.end
// ino.method.String2Int.24898.definition
public int String2Int()
// ino.end
// ino.method.String2Int.24898.body
{
return Integer.decode(lexem);
}
// ino.end
public long String2Long()
{
return Long.decode(lexem);
}
public float String2Float()
{
return Float.parseFloat(lexem);
}
public double String2Double()
{
return Double.parseDouble(lexem);
}
// ino.method.CharInString.24901.definition
public char CharInString()
// ino.end
// ino.method.CharInString.24901.body
{
char[] tmp = lexem.toCharArray();
return tmp[1];
}
// ino.end
// ino.method.String2Bool.24904.definition
public boolean String2Bool()
// ino.end
// ino.method.String2Bool.24904.body
{
if(lexem.equals("true"))
{
return(true);
}
else
{
return(false);
}
}
// ino.end
// ino.method.get_String.24907.definition
public String get_String()
// ino.end
// ino.method.get_String.24907.body
{
int laenge = lexem.length();
String rueck;
rueck = lexem.substring(1,laenge-1);
return rueck;
}
// ino.end
}
// ino.end