/* sxr -- Scala X-Ray
 * Copyright 2009 Mark Harrah
 */

package sxr

/** Represents a link to a definition.  The path is the path to the file and target is
* the symbol ID targeted.  The '#' is not included.  To get the constructed path,
* call toString. */
private class class Link extends java.lang.Object with NotNull with ScalaObjectLink(val Stringpath: StringString, val Stringtarget: StringString) extends NotNullNotNull
{
	override def ()java.lang.StringtoString = => Stringpath (Any)java.lang.String+ java.lang.String("#")"#" (Any)java.lang.String+ => Stringtarget
}
private object object sxr.BlockLinkBlockLink extends sxr.LinkLink(java.lang.String("")"", java.lang.String("")"")
/** Represents a token at the lexer level with associated type information.
* 'start' is the offset of the token in the original source file.
* 'length' is the length of the token in the original source file
* 'code' is the class of the token (see Tokens in the compiler)*/
private case class class Token extends java.lang.Object with NotNull with Ordered[sxr.Token] with ScalaObject with ProductToken(Intstart: IntInt, Intlength: IntInt, Intcode: IntInt) extends NotNullNotNull with Ordered[sxr.Token]Ordered[Token]
{
	(Boolean)Unitrequire(=> Intstart (Int)Boolean>= Int(0)0)
	(Boolean)Unitrequire(=> Intlength (Int)Boolean> Int(0)0)
	/** Tokens are sorted by their start position, so that they may be searched by offset in
	* the extraction code and then processed in sequence in the annotation code. */
	def (sxr.Token)Intcompare(sxr.Tokenother: sxr.TokenToken) = implicit scala.Predef.intWrapper : (Int)scala.runtime.RichIntstart (Int)Intcompare sxr.Tokenother.=> Intstart
	
	private[this] var Option[sxr.TypeAttribute]rawType: Option[sxr.TypeAttribute]Option[TypeAttribute] = object NoneNone
	private[this] var Option[sxr.Link]rawReference: Option[sxr.Link]Option[Link] = object NoneNone
	private[this] var List[Int]rawDefinitions: List[Int]List[Int] = object NilNil
	/** Sets the type information for this token. */
	def (sxr.TypeAttribute)Unittpe_=(sxr.TypeAttributet: sxr.TypeAttributeTypeAttribute)
	{
		Unitif(Option[sxr.TypeAttribute]rawType.=> BooleanisEmpty)
			Option[sxr.TypeAttribute]rawType = (sxr.TypeAttribute)Some[sxr.TypeAttribute]Some(sxr.TypeAttributet)
	}
	/** Sets the defining location for the symbol for this token. */
	def (sxr.Link)Unitreference_=(sxr.Linkl: sxr.LinkLink)
	{
		Unitif(Option[sxr.Link]rawReference.=> BooleanisEmpty)
			Option[sxr.Link]rawReference = (sxr.Link)Some[sxr.Link]Some(sxr.Linkl)
	}
	/** Adds an ID for this token.  An ID is used to mark this token as the source of a symbol. */
	def (Int)Unit+=(Intid: IntInt)
		{ List[Int]rawDefinitions (Int)List[Int]::= Intid }
	/** Gets the type information. */
	def => Option[sxr.TypeAttribute]tpe = Option[sxr.TypeAttribute]rawType
	/** Gets the link to the defining location for this token. */
	def => Option[sxr.Link]reference = Option[sxr.Link]rawReference
	/** Gets the definition IDs. */
	def => List[Int]definitions = List[Int]rawDefinitions
	/** True if this token has no reference to a definition and has no definitions itself. */
	def => BooleanisSimple = => Option[sxr.Link]reference.=> BooleanisEmpty (Boolean)Boolean&& => List[Int]definitions.=> BooleanisEmpty
	/** True if this token has no reference to a definition, has no definitions itself, and
	* has no type information. */
	def => BooleanisPlain = => BooleanisSimple (Boolean)Boolean&& => Option[sxr.TypeAttribute]tpe.=> BooleanisEmpty
}
/** Holds type information.  This class will probably change to accomodate tokeninzing types. */
private case class class TypeAttribute extends java.lang.Object with NotNull with ScalaObject with ProductTypeAttribute(Stringname: StringString, Option[sxr.Link]definition: Option[sxr.Link]Option[Link]) extends NotNullNotNull