Class SourceElement

java.lang.Object
org.jfuncmachine.compiler.model.SourceElement
Direct Known Subclasses:
BooleanExpr, Catch, ClassDef, ClassField, EnumInitializer, EnumSwitchCase, Expression, IntSwitchCase, MethodDef, TypeSwitchCase

public abstract class SourceElement extends Object
Represents any item that is expected to have come from a particular source file
  • Field Details

    • filename

      public final String filename
      The name of the source file this element is defined in
    • lineNumber

      public final int lineNumber
      The line number in the source file where the definition of this element begins
  • Constructor Details

    • SourceElement

      public SourceElement(String filename, int lineNumber)
      Create a source element
      Parameters:
      filename - The name of the source file this element is defined in
      lineNumber - The line number in the source file where the definition of this element begins
  • Method Details

    • generateException

      public JFuncMachineException generateException(String message)
      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