org.jruby.parser
Class ParserConfiguration

java.lang.Object
  extended by org.jruby.parser.ParserConfiguration

public class ParserConfiguration
extends java.lang.Object


Constructor Summary
ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, boolean saveData, RubyInstanceConfig config)
           
ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, CompatVersion version, boolean saveData)
           
ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, RubyInstanceConfig config)
           
ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, CompatVersion version)
           
ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, CompatVersion version)
           
 
Method Summary
 org.jcodings.Encoding getDefaultEncoding()
           
 EncodingService getEncodingService()
           
 KCode getKCode()
           
 int getLineNumber()
           
 Ruby getRuntime()
           
 DynamicScope getScope()
          This method returns the appropriate first scope for the parser.
 CompatVersion getVersion()
          Get the compatibility version we're targeting with this parse.
 boolean hasExtraPositionInformation()
          Should positions of nodes provide addition information?
 boolean isDebug()
           
 boolean isDubyExtensionsEnabled()
           
 boolean isEvalParse()
          Is the requested parse for an eval()?
 boolean isInlineSource()
          Are we parsing source provided as part of the '-e' option to Ruby.
 boolean isSaveData()
          Get whether we are saving the DATA contents of the file.
 void parseAsBlock(DynamicScope existingScope)
          If we are performing an eval we should pass existing scope in.
 void setDefaultEncoding(org.jcodings.Encoding encoding)
           
 void setEvalParse(boolean isEvalParse)
          Set whether this is an parsing of an eval() or not.
 void setExtraPositionInformation(boolean extraPositionInformation)
          Should positions of nodes provide additional information in them (like character offsets).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserConfiguration

public ParserConfiguration(Ruby runtime,
                           int lineNumber,
                           boolean inlineSource,
                           CompatVersion version)

ParserConfiguration

public ParserConfiguration(Ruby runtime,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           CompatVersion version)

ParserConfiguration

public ParserConfiguration(Ruby runtime,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           boolean isFileParse,
                           CompatVersion version,
                           boolean saveData)

ParserConfiguration

public ParserConfiguration(Ruby runtime,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           boolean isFileParse,
                           RubyInstanceConfig config)

ParserConfiguration

public ParserConfiguration(Ruby runtime,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           boolean isFileParse,
                           boolean saveData,
                           RubyInstanceConfig config)
Method Detail

setDefaultEncoding

public void setDefaultEncoding(org.jcodings.Encoding encoding)

getDefaultEncoding

public org.jcodings.Encoding getDefaultEncoding()

getEncodingService

public EncodingService getEncodingService()

setEvalParse

public void setEvalParse(boolean isEvalParse)
Set whether this is an parsing of an eval() or not.

Parameters:
isEvalParse - says how we should look at it

setExtraPositionInformation

public void setExtraPositionInformation(boolean extraPositionInformation)
Should positions of nodes provide additional information in them (like character offsets).

Parameters:
extraPositionInformation -

hasExtraPositionInformation

public boolean hasExtraPositionInformation()
Should positions of nodes provide addition information?

Returns:
true if they should

isDebug

public boolean isDebug()

isEvalParse

public boolean isEvalParse()
Is the requested parse for an eval()?

Returns:
true if for eval

getKCode

public KCode getKCode()

getLineNumber

public int getLineNumber()

parseAsBlock

public void parseAsBlock(DynamicScope existingScope)
If we are performing an eval we should pass existing scope in. Calling this lets the parser know we need to do this.

Parameters:
existingScope - is the scope that captures new vars, etc...

getRuntime

public Ruby getRuntime()

getScope

public DynamicScope getScope()
This method returns the appropriate first scope for the parser.

Returns:
correct top scope for source to be parsed

getVersion

public CompatVersion getVersion()
Get the compatibility version we're targeting with this parse.


isSaveData

public boolean isSaveData()
Get whether we are saving the DATA contents of the file.


isInlineSource

public boolean isInlineSource()
Are we parsing source provided as part of the '-e' option to Ruby.

Returns:
true if source is from -e option

isDubyExtensionsEnabled

public boolean isDubyExtensionsEnabled()


Copyright © 2002-2009 JRuby Team. All Rights Reserved.