Class Tensor
- All Implemented Interfaces:
MoveCheckable,TreeMember,ParseTree,SyntaxTree,TerminalNode,Tree
A tensor abstractly represents the many multidimensional number types that
GLSL has. It does this within a single data structure by modeling scalars,
vectors and matrices as n-dimensional and also taking the bit depth into
account.
-
Field Summary
Fields inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl
parent, symbol -
Constructor Summary
ConstructorsConstructorDescriptionTensor(int tokenType)Creates a new tensor with the type given as a lexer token index.Tensor(io.github.douira.glsl_transformer.ast.Type type)Creates a new tensor with the given type.Tensor(io.github.douira.glsl_transformer.GLSLParser.BuiltinTypeSpecifierParseableContext ctx)Creates a new tensor from the given type specifier parse tree node.Creates a new tensor by parsing the type specified in the given string. -
Method Summary
Modifier and TypeMethodDescriptionprotected Function<io.github.douira.glsl_transformer.GLSLParser,ExtendedContext>This method is overwritten by the implementing class to specify with which parser method the generated string should be parsed.protected StringGenerates the string representation of this AST object as it would be in the generated code.io.github.douira.glsl_transformer.ast.TypegetType()Returns the type contained in this tensor node.voidsetType(io.github.douira.glsl_transformer.ast.Type type)Sets the type of this tensor.Methods inherited from class io.github.douira.glsl_transformer.ast.ParsableASTNode
getParsed, getParsedMethods inherited from class io.github.douira.glsl_transformer.tree.ExtendedTerminalNode
getParent, getPreviousNode, processRemoval, setPreviousNodeMethods inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl
accept, getChild, getChildCount, getPayload, getSourceInterval, getSymbol, getText, setParent, toString, toStringTree, toStringTreeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.antlr.v4.runtime.tree.ParseTree
accept, getChild, getText, setParent, toStringTreeMethods inherited from interface org.antlr.v4.runtime.tree.SyntaxTree
getSourceIntervalMethods inherited from interface org.antlr.v4.runtime.tree.Tree
getChildCount, getPayload, toStringTree
-
Constructor Details
-
Tensor
public Tensor(io.github.douira.glsl_transformer.ast.Type type)Creates a new tensor with the given type.- Parameters:
type- The type of the new tensor
-
Tensor
public Tensor(int tokenType)Creates a new tensor with the type given as a lexer token index.- Parameters:
tokenType- The token type index- See Also:
GLSLLexer
-
Tensor
public Tensor(io.github.douira.glsl_transformer.GLSLParser.BuiltinTypeSpecifierParseableContext ctx)Creates a new tensor from the given type specifier parse tree node.- Parameters:
ctx- The parse tree node to read the type from
-
Tensor
Creates a new tensor by parsing the type specified in the given string. The string should contain a builtin type specifier. See the parser grammar for details.- Parameters:
str- The string to parse as a GLSL type specifier
-
-
Method Details
-
getPrinted
Description copied from class:ASTNodeGenerates the string representation of this AST object as it would be in the generated code.- Specified by:
getPrintedin classASTNode- Returns:
- The printed string for this AST object
-
getOutputParseMethod
protected Function<io.github.douira.glsl_transformer.GLSLParser,ExtendedContext> getOutputParseMethod()Description copied from class:ParsableASTNodeThis method is overwritten by the implementing class to specify with which parser method the generated string should be parsed.- Specified by:
getOutputParseMethodin classParsableASTNode- Returns:
- A method reference from
GLSLParser
-
getType
public io.github.douira.glsl_transformer.ast.Type getType()Returns the type contained in this tensor node.- Returns:
- The type of this tensor
-
setType
public void setType(io.github.douira.glsl_transformer.ast.Type type)Sets the type of this tensor.- Parameters:
type- The new type of this tensor
-