org.jruby.parser
Class ParserConfiguration

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

public class ParserConfiguration
extends java.lang.Object


Constructor Summary
ParserConfiguration(KCode kCode, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, CompatVersion version)
           
ParserConfiguration(KCode kCode, int lineNumber, boolean extraPositionInformation, boolean inlineSource, CompatVersion version)
           
ParserConfiguration(KCode kCode, int lineNumber, boolean inlineSource, CompatVersion version)
           
 
Method Summary
 KCode getKCode()
           
 int getLineNumber()
           
 DynamicScope getScope()
          This method returns the appropriate first scope for the parser.
 CompatVersion getVersion()
           
 boolean hasExtraPositionInformation()
          Should positions of nodes provide addition information?
 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.
 void parseAsBlock(DynamicScope existingScope)
          If we are performing an eval we should pass existing scope in.
 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(KCode kCode,
                           int lineNumber,
                           boolean inlineSource,
                           CompatVersion version)

ParserConfiguration

public ParserConfiguration(KCode kCode,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           CompatVersion version)

ParserConfiguration

public ParserConfiguration(KCode kCode,
                           int lineNumber,
                           boolean extraPositionInformation,
                           boolean inlineSource,
                           boolean isFileParse,
                           CompatVersion version)
Method Detail

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

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...

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()

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-2007 JRuby Team. All Rights Reserved.