SyntaxElement

Interface

A syntax element. This instance controls the matching and compiling for a specific element. The library it comes from controls where it can be matched.

Modifiers

public abstract

Methods


compile (Context, Match)

Abstract Method

This is called during the second compiler pass, In->Out, L->R. Non-trivial syntax may need to override this to provide special behaviour.

IndexTypeName
1Contextcontext
2Matchmatch
Return Type

void

Modifiers

public abstract

getReturnType ()

Method

The return type of this element, used for type tracking during compilation.

Return Type

Type

Modifiers

public

match (String, Context)

Method

Attempts to match this element to a source string. The context can be accessed, but should not be modified here.

If the source does not match this element, return null. If the source does match this element, return a match object with the match data in.

Complex patterns are advised to override this and attempt faster checks with string.contains(part) before running the super matcher. This will circumvent a complex regex having to be checked every time.

IndexTypeName
1Stringthing
2Contextcontext
Return Type

Match

Modifiers

public

getHandler (HandlerType)

Abstract Method

For basic syntax, this can return a method that will be used as a handle.

IndexTypeName
1HandlerTypetype
Return Type

Method

Modifiers

public abstract

getProvider ()

Abstract Method

The library that provides this syntax element.

Return Type

Library

Modifiers

public abstract

getPattern ()

Abstract Method

The pattern metadata object.

Return Type

Pattern

Modifiers

public abstract

hasHandler (HandlerType)

Abstract Method
No description is available for this element.
IndexTypeName
1HandlerTypetype
Return Type

boolean

Modifiers

public abstract

setHandler (HandlerType, Method)

Abstract Method
No description is available for this element.
IndexTypeName
1HandlerTypetype
2Methodmethod
Return Type

void

Modifiers

public abstract

getSubState ()

Method
No description is available for this element.
Return Type

CompileState

Modifiers

public

prepareExpectedTypes (Context, Method)

Method
No description is available for this element.
IndexTypeName
1Contextcontext
2Methodtarget
Return Type

void

Modifiers

public

allowAsInputFor (Type)

Method
No description is available for this element.
IndexTypeName
1Typetype
Return Type

boolean

Modifiers

public

preCompile (Context, Match)

Method

This is called during the first compiler pass, Out->In, L->R. Simple elements will not need this, but lookahead or re-ordering operations can be run here.

IndexTypeName
1Contextcontext
2Matchmatch
Return Type

void

Modifiers

public

writeCall (MethodBuilder, Method, Context)

Method

This writes a smart method call for the syntax, obeying rewrite rules. This can perform inlining, extraction and basic rewrites. This also has access to the bridge compiler.

IndexTypeName
1MethodBuilderbuilder
2Methodmethod
3Contextcontext
Return Type

void

Modifiers

public

findMethod (Class, String, Class...)

Method

A wrapped version of class.getMethod(...) to avoid catching exceptions.

IndexTypeName
1Classowner
2Stringname
3Class[]parameters
Return Type

Method

Modifiers

public varargs

assemble (int, String...)

Method

For script reassembly - taking the post-parse structure and generating a (new) text script from it.

This has not been implemented yet.

IndexTypeName
1intline
2String[]inputs
Return Type

String

Modifiers

public varargs

createDocument ()

Method

Create the Skript documentation for this syntax.

Return Type

Document

Modifiers

public