Package org.mozilla.javascript
Class CompilerEnvirons
- java.lang.Object
- 
- org.mozilla.javascript.CompilerEnvirons
 
- 
 public class CompilerEnvirons extends java.lang.Object
- 
- 
Constructor SummaryConstructors Constructor Description CompilerEnvirons()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>getActivationNames()booleangetAllowSharpComments()ErrorReportergetErrorReporter()intgetLanguageVersion()intgetOptimizationLevel()booleangetWarnTrailingComma()static CompilerEnvironsideEnvirons()Returns aCompilerEnvironssuitable for using Rhino in an IDE environment.voidinitFromContext(Context cx)booleanisAllowMemberExprAsFunctionName()Extension to ECMA: if 'function <name>' is not followed by '(', assume <name> starts amemberExprbooleanisGenerateDebugInfo()booleanisGenerateObserverCount()booleanisGeneratingSource()booleanisIdeMode()booleanisRecordingComments()booleanisRecordingLocalJsDocComments()booleanisReservedKeywordAsIdentifier()booleanisStrictMode()booleanisXmlAvailable()booleanrecoverFromErrors()booleanreportWarningAsError()voidsetActivationNames(java.util.Set<java.lang.String> activationNames)voidsetAllowMemberExprAsFunctionName(boolean flag)voidsetAllowSharpComments(boolean allow)Mozilla sources use the C preprocessor.voidsetErrorReporter(ErrorReporter errorReporter)voidsetGenerateDebugInfo(boolean flag)voidsetGenerateObserverCount(boolean generateObserverCount)Turn on or off generation of code with callbacks to track the count of executed instructions.voidsetGeneratingSource(boolean generatingSource)Specify whether or not source information should be generated.voidsetIdeMode(boolean ide)Puts the parser in "IDE" mode.voidsetLanguageVersion(int languageVersion)voidsetOptimizationLevel(int level)voidsetRecordingComments(boolean record)voidsetRecordingLocalJsDocComments(boolean record)voidsetRecoverFromErrors(boolean recover)Turn on or off full error recovery.voidsetReservedKeywordAsIdentifier(boolean flag)voidsetStrictMode(boolean strict)voidsetWarnTrailingComma(boolean warn)voidsetXmlAvailable(boolean flag)
 
- 
- 
- 
Method Detail- 
initFromContextpublic void initFromContext(Context cx) 
 - 
getErrorReporterpublic final ErrorReporter getErrorReporter() 
 - 
setErrorReporterpublic void setErrorReporter(ErrorReporter errorReporter) 
 - 
getLanguageVersionpublic final int getLanguageVersion() 
 - 
setLanguageVersionpublic void setLanguageVersion(int languageVersion) 
 - 
isGenerateDebugInfopublic final boolean isGenerateDebugInfo() 
 - 
setGenerateDebugInfopublic void setGenerateDebugInfo(boolean flag) 
 - 
isReservedKeywordAsIdentifierpublic final boolean isReservedKeywordAsIdentifier() 
 - 
setReservedKeywordAsIdentifierpublic void setReservedKeywordAsIdentifier(boolean flag) 
 - 
isAllowMemberExprAsFunctionNamepublic final boolean isAllowMemberExprAsFunctionName() Extension to ECMA: if 'function <name>' is not followed by '(', assume <name> starts amemberExpr
 - 
setAllowMemberExprAsFunctionNamepublic void setAllowMemberExprAsFunctionName(boolean flag) 
 - 
isXmlAvailablepublic final boolean isXmlAvailable() 
 - 
setXmlAvailablepublic void setXmlAvailable(boolean flag) 
 - 
getOptimizationLevelpublic final int getOptimizationLevel() 
 - 
setOptimizationLevelpublic void setOptimizationLevel(int level) 
 - 
isGeneratingSourcepublic final boolean isGeneratingSource() 
 - 
getWarnTrailingCommapublic boolean getWarnTrailingComma() 
 - 
setWarnTrailingCommapublic void setWarnTrailingComma(boolean warn) 
 - 
isStrictModepublic final boolean isStrictMode() 
 - 
setStrictModepublic void setStrictMode(boolean strict) 
 - 
reportWarningAsErrorpublic final boolean reportWarningAsError() 
 - 
setGeneratingSourcepublic void setGeneratingSource(boolean generatingSource) Specify whether or not source information should be generated.Without source information, evaluating the "toString" method on JavaScript functions produces only "[native code]" for the body of the function. Note that code generated without source is not fully ECMA conformant. 
 - 
isGenerateObserverCountpublic boolean isGenerateObserverCount() - Returns:
- true iff code will be generated with callbacks to enable instruction thresholds
 
 - 
setGenerateObserverCountpublic void setGenerateObserverCount(boolean generateObserverCount) Turn on or off generation of code with callbacks to track the count of executed instructions. Currently only affects JVM byte code generation: this slows down the generated code, but code generated without the callbacks will not be counted toward instruction thresholds. Rhino's interpretive mode does instruction counting without inserting callbacks, so there is no requirement to compile code differently.- Parameters:
- generateObserverCount- if true, generated code will contain calls to accumulate an estimate of the instructions executed.
 
 - 
isRecordingCommentspublic boolean isRecordingComments() 
 - 
setRecordingCommentspublic void setRecordingComments(boolean record) 
 - 
isRecordingLocalJsDocCommentspublic boolean isRecordingLocalJsDocComments() 
 - 
setRecordingLocalJsDocCommentspublic void setRecordingLocalJsDocComments(boolean record) 
 - 
setRecoverFromErrorspublic void setRecoverFromErrors(boolean recover) Turn on or off full error recovery. In this mode, parse errors do not throw an exception, and the parser attempts to build a full syntax tree from the input. Useful for IDEs and other frontends.
 - 
recoverFromErrorspublic boolean recoverFromErrors() 
 - 
setIdeModepublic void setIdeMode(boolean ide) Puts the parser in "IDE" mode. This enables some slightly more expensive computations, such as figuring out helpful error bounds.
 - 
isIdeModepublic boolean isIdeMode() 
 - 
getActivationNamespublic java.util.Set<java.lang.String> getActivationNames() 
 - 
setActivationNamespublic void setActivationNames(java.util.Set<java.lang.String> activationNames) 
 - 
setAllowSharpCommentspublic void setAllowSharpComments(boolean allow) Mozilla sources use the C preprocessor.
 - 
getAllowSharpCommentspublic boolean getAllowSharpComments() 
 - 
ideEnvironspublic static CompilerEnvirons ideEnvirons() Returns aCompilerEnvironssuitable for using Rhino in an IDE environment. Most features are enabled by default. TheErrorReporteris set to anErrorCollector.
 
- 
 
-