package model
Provides base classes to model HAST nodes for Stack Overflow artifacts.
Overview
Every note of the HAST implements the HASTNode trait.
Depending on the specific fragment, nodes implement traits in different packages. For example:
- ch.usi.inf.reveal.parsing.model.java;
- ch.usi.inf.reveal.parsing.model.json;
- ch.usi.inf.reveal.parsing.model.stacktraces;
- ch.usi.inf.reveal.parsing.model.xml;
- and the package for visitors, ch.usi.inf.reveal.parsing.model.visitors.
Special nodes are used for various purposes, and are contained in this package:
- HASTNodeSequence for sequences of structured fragments;
- CommentNode for comments, which are special nodes in the HAST;
- TextFragmentNode for textual (natural language narrative) fragments.
- Alphabetic
- By Inheritance
- model
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
CommentNode
extends ParseTreeNode with EmbeddedContentsProvider
A comment node.
A comment node.
This common trait is used to hold comments, which are not normally considered as HAST nodes, but they are included for additional analyses (e.g. the ones involving documentation or natural language). It may provide embedded contents, e.g., documentation contents, or unstructured data.
-
trait
EmbeddedContentsNode
extends HASTNode
Represents the embedded contents of a node, that is, a sequence of H-AST nodes representing the structured contents of the node itself.
-
trait
EmbeddedContentsProvider
extends AnyRef
Represents a H-AST node that optionally contains some embedded contents.
-
case class
GenericEmbeddedContentsNode
(nodes: Seq[HASTNode]) extends HASTNode with EmbeddedContentsNode with Product with Serializable
A generic implementation for embedded contents, where each node can be any type of HAST node.
-
trait
HASTNode
extends Product with JsonSerializable
A node of the heterogeneous AST node.
-
case class
HASTNodeSequence
(fragments: Seq[HASTNode]) extends HASTNode with Product with Serializable
A simple HAST node representing a sequence of fragments.
A simple HAST node representing a sequence of fragments.
- fragments
a sequence of HAST nodes.
-
trait
IslandParserResult
extends AnyRef
A generic trait for results of Island Parsing.
-
trait
JsonSerializable
extends AnyRef
A tagger trait for case classes which can be serialized to JSON.
-
case class
PTIdentifierNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for identifiers.
-
case class
PTKeywordNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for keywords.
-
case class
PTLiteralNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for literals.
-
case class
PTModifierNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for modifier keywords (e.g., public).
-
case class
PTOperatorNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for operators.
-
case class
PTSeparatorNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node for separators (e.g., commas).
-
case class
PTWaterNode
(valueRep: String) extends ParseTreeNode with ParseTreeToCodeImplementation with Product with Serializable
A parse tree terminal node that represents water in the island languages.
-
case class
ParseTreeInternalNode
(children: Seq[ParseTreeNode]) extends ParseTreeNode with Product with Serializable
An internal node of the parse tree (i.e., a node with children).
An internal node of the parse tree (i.e., a node with children).
- children
the children of the internal node.
-
trait
ParseTreeNode
extends AnyRef
A node in the parse tree.
-
trait
ParseTreeToCodeImplementation
extends AnyRef
A trait providing a default implementation for terminal nodes in the parse tree.
-
case class
StructuredFragmentResult
(tree: Tree[HASTNode]) extends IslandParserResult with Product with Serializable
A structured fragment result, that is, a parsing result that contains some fragment of a structured language (e.g.
A structured fragment result, that is, a parsing result that contains some fragment of a structured language (e.g. code or markup languages like JSON).
-
trait
TestingRepresentation
extends AnyRef
Common trait for code conversion, generally used for testing purposes.
-
case class
TextFragmentNode
(text: String) extends ASTTerminalNode with BlockStatementNode with MemberDeclarationNode with JavadocASTNode with Product with Serializable
A text fragment node.
A text fragment node.
To support island with lakes, this is also a block statement and a member declaration node, but the corresponding methods have no effect.
- text
the text of the fragment
-
case class
TextFragmentResult
(tree: Tree[TextFragmentNode]) extends IslandParserResult with Product with Serializable
A text fragment result, that is, a parsing result that mainly contains a textual fragment.
-
case class
Tree
[+NodeType <: HASTNode](ast: NodeType, parseTree: ParseTreeNode) extends Product with Serializable
Represents a combination of an HAST of a given type and the corresponding parse tree.
Represents a combination of an HAST of a given type and the corresponding parse tree.
- NodeType
The type of the HAST.
-
case class
WhiteSpaceNode
(text: String) extends ParseTreeNode with Product with Serializable
A parse tree terminal node representing white space.
Value Members
-
object
Implicits
If imported, allows to generate code from a HASTNode.
If imported, allows to generate code from a HASTNode. It automatically includes and manages implicit conversions for ch.usi.inf.reveal.parsing.model.json.JsonASTNode, ch.usi.inf.reveal.parsing.model.java.JavaASTNode, ch.usi.inf.reveal.parsing.model.xml.XmlASTNode, TextFragmentNode, and ch.usi.inf.reveal.parsing.model.stacktraces.StackTraceASTNode.