Package java_cup.runtime
Class ComplexSymbolFactory.Location
- java.lang.Object
-
- java_cup.runtime.ComplexSymbolFactory.Location
-
- Enclosing class:
- ComplexSymbolFactory
public static class ComplexSymbolFactory.Location extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Location(int line, int column)
Location Object stores line and columnLocation(int line, int column, int offset)
Location Object stores line, column and offset to the file startLocation(ComplexSymbolFactory.Location other)
Copy Constructor for other ComplexSymbolFactory based LocationsLocation(java.lang.String unit, int line, int column)
Location Object stores compilation unit, line and columnLocation(java.lang.String unit, int line, int column, int offset)
Location Object stores compilation unit, line, column and offset to the file start
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ComplexSymbolFactory.Location
clone(ComplexSymbolFactory.Location other)
Cloning factory methodint
getColumn()
getColumnint
getLine()
getLineint
getOffset()
getOffsetjava.lang.String
getUnit()
getUnitvoid
move(int linediff, int coldiff, int offsetdiff)
move moves this Location by the given differences.java.lang.String
toString()
getLinevoid
toXML(javax.xml.stream.XMLStreamWriter writer, java.lang.String orientation)
Writes the location information directly into an XML document
-
-
-
Constructor Detail
-
Location
public Location(ComplexSymbolFactory.Location other)
Copy Constructor for other ComplexSymbolFactory based Locations- Parameters:
other
-
-
Location
public Location(java.lang.String unit, int line, int column, int offset)
Location Object stores compilation unit, line, column and offset to the file start- Parameters:
unit
- compilation unit, e.g. file nameline
- line numbercolumn
- column numberoffset
- offset from file start
-
Location
public Location(java.lang.String unit, int line, int column)
Location Object stores compilation unit, line and column- Parameters:
unit
- compilation unit, e.g. file nameline
- line numbercolumn
- column number
-
Location
public Location(int line, int column, int offset)
Location Object stores line, column and offset to the file start- Parameters:
line
- line numbercolumn
- column numberoffset
- offset from file start
-
Location
public Location(int line, int column)
Location Object stores line and column- Parameters:
line
- line numbercolumn
- column number
-
-
Method Detail
-
getColumn
public int getColumn()
getColumn
-
getLine
public int getLine()
getLine
-
move
public void move(int linediff, int coldiff, int offsetdiff)
move moves this Location by the given differences.- Parameters:
linediff
-coldiff
-offsetdiff
-
-
clone
public static ComplexSymbolFactory.Location clone(ComplexSymbolFactory.Location other)
Cloning factory method- Parameters:
other
-- Returns:
- new cloned Location
-
getUnit
public java.lang.String getUnit()
getUnit
-
toString
public java.lang.String toString()
getLine- Overrides:
toString
in classjava.lang.Object
-
toXML
public void toXML(javax.xml.stream.XMLStreamWriter writer, java.lang.String orientation) throws javax.xml.stream.XMLStreamException
Writes the location information directly into an XML document- Parameters:
writer
- the destination XML Documentorientation
- adds details about the orientation of this location as an attribute; often used with the strings "left" or "right"- Throws:
javax.xml.stream.XMLStreamException
-
getOffset
public int getOffset()
getOffset
-
-