Package org.jfuncmachine.compiler.model
Class SourceElement
java.lang.Object
org.jfuncmachine.compiler.model.SourceElement
- Direct Known Subclasses:
BooleanExpr,Catch,ClassDef,ClassField,EnumInitializer,EnumSwitchCase,Expression,IntSwitchCase,MethodDef,TypeSwitchCase
Represents any item that is expected to have come from a particular source file
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe name of the source file this element is defined infinal intThe line number in the source file where the definition of this element begins -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateException(String message) Creates an exception that contains this source element's filename and line number (if present)
-
Field Details
-
filename
The name of the source file this element is defined in -
lineNumber
public final int lineNumberThe line number in the source file where the definition of this element begins
-
-
Constructor Details
-
SourceElement
Create a source element- Parameters:
filename- The name of the source file this element is defined inlineNumber- The line number in the source file where the definition of this element begins
-
-
Method Details
-
generateException
Creates an exception that contains this source element's filename and line number (if present)- Parameters:
message- The message contained in the exception- Returns:
- A JFuncMachineException containing the filename and lineNumber if present
-