public class ASC extends Object
Although ASC
can parse most of the command-line options supported by
the old ASC, only a few of them are implemented at the moment.
Constructor and Description |
---|
ASC() |
Modifier and Type | Method and Description |
---|---|
void |
addImportFilename(String filename) |
void |
addIncludeFilename(String filename) |
void |
addNamespace(String namespace) |
void |
addOptimizerConfig(String value) |
void |
addSourceFilename(String source) |
boolean |
getABCFuture() |
int |
getApiVersion() |
String |
getAvmplusFilename() |
Map<String,String> |
getConfigVars() |
int |
getDialect() |
boolean |
getEmitDebugInfo() |
boolean |
getEmitDocInfo() |
boolean |
getEmitMetadata() |
List<String> |
getExternalLibraries() |
int |
getFrameRate() |
int |
getHeight() |
List<String> |
getImportFilenames() |
List<String> |
getIncludeFilenames() |
List<String> |
getInternalLibraries() |
Locale |
getLocale() |
boolean |
getMakeMovieClip() |
boolean |
getMergeABCs() |
List<String> |
getNamespaces() |
boolean |
getOptimize() |
List<String> |
getOptimizerConfigs() |
String |
getOutputBasename()
Get the user specified basename.
|
String |
getOutputDirectory()
Get the user specified output directory.
|
boolean |
getParallel()
Gets a boolean that indicates whether or not parallel code generation of
method bodies is enabled.
|
String |
getProblems() |
boolean |
getRemoveDeadCode() |
boolean |
getShowBytes() |
boolean |
getShowFlowGraph() |
boolean |
getShowInstructions() |
boolean |
getShowLineNumbers() |
boolean |
getShowLog() |
boolean |
getShowMachineCode() |
boolean |
getShowParseTrees() |
boolean |
getShowWarnings() |
List<String> |
getSourceFilenames() |
String |
getSymbolClass() |
int |
getTargetAVM() |
boolean |
getUseSanityMode() |
int |
getWidth() |
boolean |
isGenerateSWF() |
boolean |
isInliningEnabled()
Gets a boolean that indicates whether or not inlining of
method bodies is enabled.
|
static void |
main(String[] args)
Entry point for ASC command-line.
|
int |
mainNoExit(String[] args)
Do not call
System.exit(int) here to allow unit testing. |
int |
mainNoExit(String[] args,
PrintStream out,
PrintStream err)
Do not call
System.exit(int) here to allow unit testing. |
void |
putConfigVar(String key,
String value)
Sets a config var key/value pair used in conditional compilation.
|
void |
setABCFuture(boolean b) |
void |
setApiVersion(String version) |
void |
setAvmplusFilename(String filename) |
void |
setDialect(String dialect) |
void |
setEmitDebugInfo(boolean emitDebugInfo) |
void |
setEmitDocInfo(boolean emitDocInfo) |
void |
setEmitMetadata(boolean emitMetadata) |
void |
setEnableInlining(boolean enableInlining)
Enables or disables parallel code generation of method bodies.
|
void |
setFrameRate(String frameRate) |
void |
setHeight(String height) |
void |
setLocale(Locale locale) |
void |
setMakeMovieClip(boolean makeMovieClip) |
void |
setMergeABCs(boolean mergeABCs) |
void |
setOptimize(boolean optimize) |
void |
setOutputBasename(String outputBasename)
Set the basename.
|
void |
setOutputDirectory(String outputDirectory)
Set the output directory from the "-outdir" option.
|
void |
setParallel(boolean parallel)
Enables or disables parallel code generation of method bodies.
|
void |
setRemoveDeadCode(boolean removeDeadCode)
Enable or disable dead code removal.
|
void |
setShowBytes(boolean showBytes) |
void |
setShowFlowGraph(boolean showFlowGraph) |
void |
setShowInstructions(boolean showInstructions) |
void |
setShowLineNumbers(boolean showLineNumbers) |
void |
setShowLog(boolean showLog) |
void |
setShowMachineCode(boolean showMachineCode) |
void |
setShowParseTrees(boolean showParseTrees) |
void |
setShowWarnings(boolean showWarnings) |
void |
setSymbolClass(String symbolClass) |
void |
setTargetAVM(String version) |
void |
setUseSanityMode(boolean useSanityMode) |
void |
setUseStaticSemantics(boolean useStaticSemantics) |
void |
setWidth(String width) |
boolean |
useStaticSemantics() |
public static void main(String[] args)
public int mainNoExit(String[] args)
System.exit(int)
here to allow unit testing.
Uses System.out and System.err as default streamsargs
- argumentspublic int mainNoExit(String[] args, PrintStream out, PrintStream err)
System.exit(int)
here to allow unit testing.args
- argumentsout
- stdout printstreamerr
- stderr printstreampublic String getProblems()
public List<String> getSourceFilenames()
public void addSourceFilename(String source)
source
- - a root source filename to compilepublic List<String> getIncludeFilenames()
public void addIncludeFilename(String filename)
filename
- - a source filename to include in compilationpublic List<String> getImportFilenames()
public void addImportFilename(String filename)
filename
- - an ABC filename to importpublic Map<String,String> getConfigVars()
public void putConfigVar(String key, String value)
key
- - the config var namevalue
- - the config var valuepublic List<String> getNamespaces()
public void addNamespace(String namespace)
namespace
- - a namespace to be automatically used (opened) during
compilationpublic int getApiVersion()
public void setApiVersion(String version)
version
- - the native API version of the runtimepublic int getDialect()
public void setDialect(String dialect)
dialect
- - the ActionScript language dialect to set for compilationpublic int getTargetAVM()
public void setTargetAVM(String version)
version
- - the version of the ActionScript Virtual Machine that
generated byte code should target, either 1 for AVM1 or 2 for AVM2.public boolean useStaticSemantics()
public void setUseStaticSemantics(boolean useStaticSemantics)
useStaticSemantics
- - determines whether static semantics should be
used?public boolean getShowWarnings()
public void setShowWarnings(boolean showWarnings)
showWarnings
- - determines whether warnings for common ActionScript
mistakes should be shownpublic boolean getUseSanityMode()
public void setUseSanityMode(boolean useSanityMode)
useSanityMode
- - determines whether system-independent
error/warning output should be usedpublic Locale getLocale()
public void setLocale(Locale locale)
locale
- - the locale to use for compiler errors and warningspublic boolean getMakeMovieClip()
public void setMakeMovieClip(boolean makeMovieClip)
makeMovieClip
- - determines whether a movieclip should be made?public String getSymbolClass()
public void setSymbolClass(String symbolClass)
symbolClass
- - the name of top-level SymbolClass to use in a SWFpublic boolean isGenerateSWF()
-swf
argument is set.public int getWidth()
public void setWidth(String width)
width
- - the SWF stage widthpublic int getHeight()
public void setHeight(String height)
height
- - the SWF stage heightpublic int getFrameRate()
public void setFrameRate(String frameRate)
frameRate
- - the SWF frame ratepublic boolean getEmitDebugInfo()
public boolean getABCFuture()
public void setABCFuture(boolean b)
b
- determines if we should emit a 47.14 ABC or notpublic void setEmitDebugInfo(boolean emitDebugInfo)
emitDebugInfo
- - determines whether debug info should be emitted
into the byte codepublic boolean getEmitDocInfo()
public void setEmitDocInfo(boolean emitDocInfo)
emitDocInfo
- - determines whether asdoc info should be emitted into
the byte codepublic boolean getEmitMetadata()
public void setEmitMetadata(boolean emitMetadata)
emitMetadata
- - determines whether metadata should be emitted into
the byte codepublic String getAvmplusFilename()
public void setAvmplusFilename(String filename)
filename
- - the avmplus executable filename to use to create a
projector filepublic boolean getShowBytes()
public void setShowBytes(boolean showBytes)
showBytes
- - determines whether bytes should be shown in a dump of
the generated ABCpublic boolean getShowParseTrees()
public void setShowParseTrees(boolean showParseTrees)
showParseTrees
- - determines whether the parse tree should be
written to a .p filepublic boolean getShowInstructions()
public void setShowInstructions(boolean showInstructions)
showInstructions
- - determines whether intermediate code should be
written to a .il filepublic boolean getShowLineNumbers()
public void setShowLineNumbers(boolean showLineNumbers)
showLineNumbers
- - determines whether line numbers should be shown
in the dump of generated ABC bytespublic boolean getShowMachineCode()
public void setShowMachineCode(boolean showMachineCode)
showMachineCode
- - determines whether AVM+ assembly code should be
included in the .il filepublic boolean getShowFlowGraph()
public void setShowFlowGraph(boolean showFlowGraph)
showFlowGraph
- - determines whether the flow graph should be
printed to standard outpublic boolean getShowLog()
public void setShowLog(boolean showLog)
showLog
- - determines whether logging information should be shownpublic boolean getOptimize()
public void setOptimize(boolean optimize)
optimize
- - determines whether the generated ABC should be
optimizedpublic List<String> getOptimizerConfigs()
public void addOptimizerConfig(String value)
value
- - a configuration option for the optimizer, potentially
specified as a 'name=value' Stringpublic boolean getMergeABCs()
public void setMergeABCs(boolean mergeABCs)
mergeABCs
- true to turn on ABC merging, false to turn off.public String getOutputDirectory()
public void setOutputDirectory(String outputDirectory)
outputDirectory
- A path string.public String getOutputBasename()
public void setOutputBasename(String outputBasename)
outputBasename
- The base name of the output file.public boolean getParallel()
public void setParallel(boolean parallel)
parallel
- If true, method bodies will be generated in parallel.public boolean isInliningEnabled()
public void setEnableInlining(boolean enableInlining)
enableInlining
- If true, method bodies will be generated in parallel.public void setRemoveDeadCode(boolean removeDeadCode)
removeDeadCode
- true if dead code is to be removed.public boolean getRemoveDeadCode()
Copyright © 2016 The Apache Software Foundation. All rights reserved.