class NotationBasedPresenter extends ObjectPresenter
presents objects using notations
The main methods do not produce any rendering themselves. Instead, they call special methods that may be overridden for customization. The default implementations produce plain text.
The bracket placement algorithm is only approximate. It will sometimes put too many and sometimes too few brackets. The latter will confuse the NotationBasedParser, but rarely humans.
- Alphabetic
- By Inheritance
- NotationBasedPresenter
- ObjectPresenter
- Extension
- Logger
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new NotationBasedPresenter()
Type Members
-
case class
LocalError(s: String) extends ExtensionError with Product with Serializable
a custom error class for this extension
a custom error class for this extension
- Definition Classes
- Extension
-
type
Cont = () ⇒ Unit
auxiliary type for a continuation function
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(o: Obj, origin: Option[CPath])(implicit rh: RenderingHandler): Unit
- Definition Classes
- NotationBasedPresenter → ObjectPresenter
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asString(o: Obj, origin: Option[CPath] = None): String
- Definition Classes
- ObjectPresenter
-
def
asXML(o: Obj, origin: Option[CPath] = None): Node
- Definition Classes
- ObjectPresenter
-
def
catchErrors[A](msg: String, recoverWith: ⇒ A)(code: ⇒ A): A
like its partner but with return value
like its partner but with return value
- Attributes
- protected
- Definition Classes
- Extension
-
def
catchErrors(msg: String)(code: ⇒ Unit): Unit
convenience method for wrapping code in error handler that throws LocalError
convenience method for wrapping code in error handler that throws LocalError
- Attributes
- protected
- Definition Classes
- Extension
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
controller: Controller
the controller that this extension is added to; only valid after creation of the extension, i.e., will return null if used in a non-lazy val-field
the controller that this extension is added to; only valid after creation of the extension, i.e., will return null if used in a non-lazy val-field
- Attributes
- protected
- Definition Classes
- Extension
-
lazy val
defaultPrefix: String
- Definition Classes
- Extension
-
def
destroy: Unit
extension-specific cleanup (override as needed, empty by default)
extension-specific cleanup (override as needed, empty by default)
Extensions may create persistent data structures and threads, but they must clean up after themselves in this method
- Definition Classes
- Extension
-
def
destroyWhenRemainingTasksFinished: Unit
convenience for calling waitUntilRemainingTasksFinished and then destroy
convenience for calling waitUntilRemainingTasksFinished and then destroy
- Definition Classes
- Extension
- def doAttributedTerm(t: Term, k: OMID, v: Term)(implicit pc: PresentationContext): Int
-
def
doBracketedGroup(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called to wrap around subexpressions that must be bracketed
called to wrap around subexpressions that must be bracketed
- body
the part between the brackets
-
def
doComplex(op: GlobalName, subs: Substitution, con: Context, args: List[Term])(implicit pc: PresentationContext): Unit
default treatment of complex terms
-
def
doDefault(o: Obj)(implicit pc: PresentationContext): Int
called on objects for which no notation is available
called on objects for which no notation is available
- returns
1/0/-1 depending on the type of bracketing applied (yes/optional/no)
-
def
doDelimiter(n: LocalName, d: Delimiter)(implicit pc: PresentationContext): Unit
called on every delimiter that is rendered through the notation of a variable
called on every delimiter that is rendered through the notation of a variable
- n
the variable name
- d
the delimiter
-
def
doDelimiter(p: GlobalName, d: Delimiter, implicits: List[Cont])(implicit pc: PresentationContext): Unit
called on every delimiter that is rendered through the notation of a symbol
called on every delimiter that is rendered through the notation of a symbol
- p
the path of the rendered notation
- d
the delimiter
- implicits
implicit arguments of the rendered term that are not explicitly placed by the notation (added to first delimiter)
- def doErrorMarker(args: List[Cont])(implicit pc: PresentationContext): Unit
- def doFraction(above: List[Cont], below: List[Cont], line: Boolean)(implicit pc: PresentationContext): Unit
- def doGlyphMarker(src: Delim, alt: String = "Failed to Load")(implicit pc: PresentationContext): Unit
- def doIdenMarker(arg: Delim)(implicit pc: PresentationContext): Unit
-
def
doIdentifier(p: ContentPath)(implicit pc: PresentationContext): Unit
called by doDefaultTerm to render symbols
called by doDefaultTerm to render symbols
names are given in human-oriented form and not parsable if there are name clashes
-
def
doImplicit(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called to wrap around subexpressions that are implicit arguments
called to wrap around subexpressions that are implicit arguments
- body
the argument
-
def
doInferredType(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called to wrap around inferred types of bound variables
called to wrap around inferred types of bound variables
- body
the argument
- def doLabelMarker(args: List[Cont], label: String)(implicit pc: PresentationContext): Unit
-
def
doListWithSeparator(l: List[Cont], sep: Cont): Unit
auxiliary function for inserting a separator (such as whitespace) into a list
- def doListWithSpace(l: List[Cont], n: Int = 1)(implicit pc: PresentationContext): Unit
-
def
doLiteral(l: OMLITTrait)(implicit pc: PresentationContext): Unit
called by doDefaultTerm to render literals
- def doNumberMarker(arg: Delim)(implicit pc: PresentationContext): Unit
-
def
doOperator(s: String)(implicit pc: PresentationContext): Unit
called by various methods to render MMT-level operators, such as ,:=()
-
def
doOptionallyBracketedGroup(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called to wrap around subexpressions that could but do not have to be bracketed
called to wrap around subexpressions that could but do not have to be bracketed
- body
the part between the brackets
- def doPhantomMarker(args: List[Cont])(implicit pc: PresentationContext): Unit
- def doPresentationMarker(m: PresentationMarker, doMarkers: (List[Marker]) ⇒ Unit)(implicit pc: PresentationContext): Unit
- def doRootMarker(base: List[Cont], root: List[Cont])(implicit pc: PresentationContext): Unit
-
def
doScript(main: ⇒ Unit, sup: Option[Cont], sub: Option[Cont], over: Option[Cont], under: Option[Cont])(implicit pc: PresentationContext): Unit
called to render a scripted object - an optional decorated by several optional scripts
called to render a scripted object - an optional decorated by several optional scripts
each script is passed as a continuation that must be called at the appropriate place
- main
the object See notations.ScriptMarker for the meaning of the scripts
-
def
doSpace(level: Int)(implicit pc: PresentationContext): Unit
called by various methods to render whitespace
called by various methods to render whitespace
- level
how big a space to produce, 0 for no space, higher levels also indicate line-breaking points
- def doSqrt(args: List[Cont])(implicit pc: PresentationContext): Unit
- def doTable(ms: List[Cont])(implicit pc: PresentationContext): Unit
- def doTd(ms: List[Cont])(implicit pc: PresentationContext): Unit
- def doTextMarker(text: Delim)(implicit pc: PresentationContext): Unit
-
def
doToplevel(o: Obj)(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called once at the toplevel of every object to be rendered
- def doTr(ms: List[Cont])(implicit pc: PresentationContext): Unit
-
def
doUnbracketedGroup(body: ⇒ Unit)(implicit pc: PresentationContext): Unit
called to wrap around subexpressions that are not bracketed
called to wrap around subexpressions that are not bracketed
- body
the part between the brackets
-
def
doVariable(n: LocalName)(implicit pc: PresentationContext): Unit
called by doDefaultTerm to render variables
- def doWord(s: String)(implicit pc: PresentationContext): Unit
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getAlias(p: GlobalName): List[LocalName]
- Attributes
- protected
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFromFirstArgOrEnvvar(args: List[String], name: String, default: String = ""): String
- Attributes
- protected
- Definition Classes
- Extension
-
implicit
def
getNotations(p: GlobalName): List[TextNotation]
- returns
an object o' that is presented instead (e.g., o itself) one position p for each component c of o' such that the c is the p-subobject of o a notation to use for presenting o'
- Attributes
- protected
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initOther(e: Extension): Unit
any extension can initialize other extensions if those are not meant to be added to the ExtensionManager
any extension can initialize other extensions if those are not meant to be added to the ExtensionManager
- Attributes
- protected
- Definition Classes
- Extension
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
log(e: Error): Unit
logs an error - always logged
logs an error - always logged
- Attributes
- protected
- Definition Classes
- Logger
-
def
log(s: ⇒ String, subgroup: Option[String] = None): Unit
logs a message with this logger's logprefix
logs a message with this logger's logprefix
- Attributes
- protected
- Definition Classes
- Logger
-
def
logError(s: ⇒ String): Unit
log as an error message
log as an error message
- Attributes
- protected
- Definition Classes
- Logger
-
def
logGroup[A](a: ⇒ A): A
wraps around a group to create nested logging
wraps around a group to create nested logging
- Attributes
- protected
- Definition Classes
- Logger
-
def
logPrefix: String
the prefix used to identify this extension for logging, by default the class name
-
def
logTemp(s: ⇒ String): Unit
temporary logging - always logged
temporary logging - always logged
- Attributes
- protected
- Definition Classes
- Logger
-
def
makeErrorThrower(msg: String): ErrorHandler
an ErrorHandler that wraps an error in a LocalError and throws it
an ErrorHandler that wraps an error in a LocalError and throws it
- Attributes
- protected
- Definition Classes
- Extension
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
preparePresentation(o: Obj, origin: Option[CPath])(implicit rh: RenderingHandler): PresentationContext
called once at the beginning of each presentation, override as needed
called once at the beginning of each presentation, override as needed
- Attributes
- protected
-
def
recurse(obj: Obj)(implicit pc: PresentationContext): Int
- Attributes
- protected
- val report: Report
-
def
start(args: List[String]): Unit
extension-specific initialization (override as needed, empty by default)
extension-specific initialization (override as needed, empty by default)
- Definition Classes
- Extension
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
twoDimensional: Boolean
1 or 2-dimensional notations, true by default
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
waitUntilRemainingTasksFinished: Unit
extensions that process tasks in separate threads should override this and wait until those threads are done
extensions that process tasks in separate threads should override this and wait until those threads are done
- Definition Classes
- Extension