public class JSEmitter extends ASEmitter implements IJSEmitter
IJSEmitter.SourceMapMapping
Constructor and Description |
---|
JSEmitter(FilterWriter out) |
Modifier and Type | Method and Description |
---|---|
protected void |
addLineToMappings(int lineIndex)
Adjusts the line numbers saved in the source map when a line should be
added during post processing.
|
void |
emitArguments(IContainerNode node) |
void |
emitBlockClose(IContainerNode node) |
void |
emitBlockOpen(IContainerNode node) |
void |
emitCatch(ICatchNode node)
Emit a
catch(){} statement. |
void |
emitClosureEnd(IASNode node,
IDefinition nodeDef) |
void |
emitClosureStart() |
void |
emitDoLoop(IWhileLoopNode node)
Emit a
do{}while() statement. |
void |
emitDynamicAccess(IDynamicAccessNode node) |
void |
emitForLoop(IForLoopNode node)
Emit a
for statement. |
void |
emitFunctionObject(IFunctionObjectNode node)
Emit an anonymous
IFunctionObjectNode . |
void |
emitIf(IIfNode node)
Emit a
if(){}else if(){}else{} statement. |
void |
emitIterationFlow(IIterationFlowNode node) |
void |
emitLanguageIdentifier(ILanguageIdentifierNode node) |
void |
emitLiteralContainer(ILiteralContainerNode node) |
void |
emitLocalNamedFunction(IFunctionNode node)
Emit an local named function
IFunctionNode . |
void |
emitMemberKeyword(IDefinitionNode node) |
void |
emitNumericLiteral(INumericLiteralNode node) |
void |
emitObjectLiteralValuePair(IObjectLiteralValuePairNode node) |
void |
emitParameter(IParameterNode node) |
void |
emitParameters(IContainerNode node) |
void |
emitReturn(IReturnNode node) |
void |
emitSourceMapDirective(ITypeNode node) |
void |
emitStatement(IASNode node)
Emit a statement found within an
IBlockNode . |
void |
emitSwitch(ISwitchNode node)
Emit a
switch(){} statement. |
void |
emitTernaryOperator(ITernaryOperatorNode node) |
void |
emitThrow(IThrowNode node)
Emit a
throw statement. |
void |
emitTry(ITryNode node)
Emit a
try{} statement. |
void |
emitTypedExpression(ITypedExpressionNode node) |
void |
emitUnaryOperator(IUnaryOperatorNode node) |
void |
emitWhileLoop(IWhileLoopNode node)
Emit a
while(){} statement. |
void |
emitWith(IWithNode node)
Emit a
with(){} statement. |
void |
endMapping(ISourceLocation node)
Commits a mapping to the source map.
|
String |
formatQualifiedName(String name) |
JSSessionModel |
getModel() |
List<IJSEmitter.SourceMapMapping> |
getSourceMapMappings() |
void |
popSourceMapName() |
void |
pushSourceMapName(ISourceLocation node) |
protected void |
removeLineFromMappings(int lineIndex)
Adjusts the line numbers saved in the source map when a line should be
removed during post processing.
|
void |
startMapping(ISourceLocation node)
Adds a node to the source map.
|
void |
startMapping(ISourceLocation node,
int line,
int column)
Adds a node to the source map using custom line and column values,
instead of the node's own line and column.
|
void |
startMapping(ISourceLocation node,
ISourceLocation afterNode)
Adds a node to the source map after a particular node instead using the
node's own line and column.
|
emitAccessorKeyword, emitAsOperator, emitAssignedValue, emitBinaryOperator, emitClass, emitContainer, emitDeclarationName, emitE4XFilter, emitField, emitFieldDocumentation, emitForEachLoop, emitFunctionBlockHeader, emitFunctionCall, emitFunctionScope, emitGetAccessor, emitGetAccessorDocumentation, emitIdentifier, emitImport, emitInterface, emitIsOperator, emitKeyword, emitLabelStatement, emitLiteral, emitMemberAccessExpression, emitMemberName, emitMetaTag, emitMethod, emitMethodDocumentation, emitMethodScope, emitModifiers, emitNamespace, emitNamespaceAccessExpression, emitNamespaceIdentifier, emitPackageContents, emitPackageFooter, emitPackageHeader, emitPackageHeaderContents, emitSetAccessor, emitSetAccessorDocumentation, emitType, emitUseNamespace, emitVarDeclaration, emitVariableExpression, findType, findTypeNode, flushBuilder, getBuilder, getConstructor, getCurrentColumn, getCurrentIndent, getCurrentLine, getDocEmitter, getIndent, getProblems, getWalker, indentPop, indentPush, isBufferWrite, isImplicit, isLastStatement, postProcess, setBufferWrite, setBuilder, setDocEmitter, setWalker, stringifyNode, visitForBody, write, write, writeIndent, writeNewline, writeNewline, writeNewline, writeNewline, writeNewline, writeSymbol, writeToken, writeToken
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
emitAsOperator, emitBinaryOperator, emitClass, emitContainer, emitE4XFilter, emitField, emitFieldDocumentation, emitForEachLoop, emitFunctionBlockHeader, emitFunctionCall, emitGetAccessor, emitGetAccessorDocumentation, emitIdentifier, emitImport, emitInterface, emitIsOperator, emitKeyword, emitLabelStatement, emitLiteral, emitMemberAccessExpression, emitMetaTag, emitMethod, emitMethodDocumentation, emitNamespace, emitNamespaceAccessExpression, emitPackageContents, emitPackageFooter, emitPackageHeader, emitPackageHeaderContents, emitSetAccessor, emitSetAccessorDocumentation, emitUseNamespace, emitVarDeclaration, emitVariableExpression, getDocEmitter, getWalker, postProcess, setDocEmitter, setWalker
indentPop, indentPush, stringifyNode, write, write, writeNewline, writeNewline, writeNewline, writeNewline, writeNewline, writeToken, writeToken
public ISubEmitter<IContainerNode> blockOpenEmitter
public ISubEmitter<IContainerNode> blockCloseEmitter
public ISubEmitter<INumericLiteralNode> numericLiteralEmitter
public ISubEmitter<IContainerNode> parametersEmitter
public ISubEmitter<IParameterNode> parameterEmitter
public ISubEmitter<IContainerNode> functionCallArgumentsEmitter
public ISubEmitter<ILiteralContainerNode> literalContainerEmitter
public ISubEmitter<IObjectLiteralValuePairNode> objectLiteralValuePairEmitter
public ISubEmitter<IReturnNode> returnEmitter
public ISubEmitter<IDynamicAccessNode> dynamicAccessEmitter
public ISubEmitter<IUnaryOperatorNode> unaryOperatorEmitter
public ISubEmitter<ITernaryOperatorNode> ternaryOperatorEmitter
public ISubEmitter<IDefinitionNode> memberKeywordEmitter
public ISubEmitter<IIfNode> ifEmitter
public ISubEmitter<ISwitchNode> switchEmitter
public ISubEmitter<IWhileLoopNode> whileLoopEmitter
public ISubEmitter<IWhileLoopNode> doWhileLoopEmitter
public ISubEmitter<IForLoopNode> forLoopEmitter
public ISubEmitter<IIterationFlowNode> interationFlowEmitter
public ISubEmitter<ITryNode> tryEmitter
public ISubEmitter<ICatchNode> catchEmitter
public ISubEmitter<IThrowNode> throwEmitter
public ISubEmitter<IWithNode> withEmitter
public ISubEmitter<IASNode> statementEmitter
public ISubEmitter<ILanguageIdentifierNode> languageIdentifierEmitter
public SourceMapDirectiveEmitter sourceMapDirectiveEmitter
public JSEmitter(FilterWriter out)
public JSSessionModel getModel()
getModel
in interface IJSEmitter
public List<IJSEmitter.SourceMapMapping> getSourceMapMappings()
getSourceMapMappings
in interface IJSEmitter
public String formatQualifiedName(String name)
formatQualifiedName
in interface IJSEmitter
public void emitLocalNamedFunction(IFunctionNode node)
IASEmitter
IFunctionNode
.emitLocalNamedFunction
in interface IASEmitter
emitLocalNamedFunction
in class ASEmitter
node
- The local named function IFunctionNode
.public void emitFunctionObject(IFunctionObjectNode node)
IASEmitter
IFunctionObjectNode
.emitFunctionObject
in interface IASEmitter
emitFunctionObject
in class ASEmitter
node
- The anonymous IFunctionObjectNode
.public void emitClosureStart()
emitClosureStart
in interface IJSEmitter
public void emitClosureEnd(IASNode node, IDefinition nodeDef)
emitClosureEnd
in interface IJSEmitter
public void emitSourceMapDirective(ITypeNode node)
emitSourceMapDirective
in interface IJSEmitter
public void emitParameters(IContainerNode node)
emitParameters
in class ASEmitter
public void emitParameter(IParameterNode node)
emitParameter
in interface IASEmitter
emitParameter
in class ASEmitter
public void emitArguments(IContainerNode node)
emitArguments
in interface IASEmitter
emitArguments
in class ASEmitter
public void emitNumericLiteral(INumericLiteralNode node)
emitNumericLiteral
in interface IASEmitter
emitNumericLiteral
in class ASEmitter
public void emitLiteralContainer(ILiteralContainerNode node)
emitLiteralContainer
in interface IASEmitter
emitLiteralContainer
in class ASEmitter
public void emitObjectLiteralValuePair(IObjectLiteralValuePairNode node)
emitObjectLiteralValuePair
in interface IASEmitter
emitObjectLiteralValuePair
in class ASEmitter
public void emitTry(ITryNode node)
IASEmitter
try{}
statement.emitTry
in interface IASEmitter
emitTry
in class ASEmitter
node
- The ITryNode
node.public void emitCatch(ICatchNode node)
IASEmitter
catch(){}
statement.emitCatch
in interface IASEmitter
emitCatch
in class ASEmitter
node
- The ICatchNode
node.public void emitWith(IWithNode node)
IASEmitter
with(){}
statement.emitWith
in interface IASEmitter
emitWith
in class ASEmitter
node
- The IWithNode
node.public void emitThrow(IThrowNode node)
IASEmitter
throw
statement.emitThrow
in interface IASEmitter
emitThrow
in class ASEmitter
node
- The IThrowNode
node.public void emitReturn(IReturnNode node)
emitReturn
in interface IASEmitter
emitReturn
in class ASEmitter
public void emitTypedExpression(ITypedExpressionNode node)
emitTypedExpression
in interface IASEmitter
emitTypedExpression
in class ASEmitter
public void emitDynamicAccess(IDynamicAccessNode node)
emitDynamicAccess
in interface IASEmitter
emitDynamicAccess
in class ASEmitter
public void emitMemberKeyword(IDefinitionNode node)
emitMemberKeyword
in class ASEmitter
public void emitUnaryOperator(IUnaryOperatorNode node)
emitUnaryOperator
in interface IASEmitter
emitUnaryOperator
in class ASEmitter
public void emitTernaryOperator(ITernaryOperatorNode node)
emitTernaryOperator
in interface IASEmitter
emitTernaryOperator
in class ASEmitter
public void emitLanguageIdentifier(ILanguageIdentifierNode node)
emitLanguageIdentifier
in interface IASEmitter
emitLanguageIdentifier
in class ASEmitter
public void emitStatement(IASNode node)
IASEmitter
IBlockNode
.emitStatement
in interface IASEmitter
emitStatement
in class ASEmitter
node
- The IASNode
statement.public void emitIf(IIfNode node)
IASEmitter
if(){}else if(){}else{}
statement.emitIf
in interface IASEmitter
emitIf
in class ASEmitter
node
- The IIfNode
node.public void emitSwitch(ISwitchNode node)
IASEmitter
switch(){}
statement.emitSwitch
in interface IASEmitter
emitSwitch
in class ASEmitter
node
- The ISwitchNode
node.public void emitWhileLoop(IWhileLoopNode node)
IASEmitter
while(){}
statement.emitWhileLoop
in interface IASEmitter
emitWhileLoop
in class ASEmitter
node
- The IWhileLoopNode
node.public void emitDoLoop(IWhileLoopNode node)
IASEmitter
do{}while()
statement.emitDoLoop
in interface IASEmitter
emitDoLoop
in class ASEmitter
node
- The IWhileLoopNode
node.public void emitForLoop(IForLoopNode node)
IASEmitter
for
statement.emitForLoop
in interface IASEmitter
emitForLoop
in class ASEmitter
node
- The IForLoopNode
node.public void emitIterationFlow(IIterationFlowNode node)
emitIterationFlow
in interface IASEmitter
emitIterationFlow
in class ASEmitter
public void emitBlockOpen(IContainerNode node)
emitBlockOpen
in interface IASEmitter
emitBlockOpen
in class ASEmitter
public void emitBlockClose(IContainerNode node)
emitBlockClose
in interface IASEmitter
emitBlockClose
in class ASEmitter
public void pushSourceMapName(ISourceLocation node)
pushSourceMapName
in interface IJSEmitter
public void popSourceMapName()
popSourceMapName
in interface IJSEmitter
public void startMapping(ISourceLocation node)
IJSEmitter
startMapping
in interface IJSEmitter
public void startMapping(ISourceLocation node, int line, int column)
IJSEmitter
startMapping
in interface IJSEmitter
public void startMapping(ISourceLocation node, ISourceLocation afterNode)
IJSEmitter
startMapping
in interface IJSEmitter
public void endMapping(ISourceLocation node)
IJSEmitter
endMapping
in interface IJSEmitter
protected void addLineToMappings(int lineIndex)
lineIndex
- protected void removeLineFromMappings(int lineIndex)
lineIndex
- Copyright © 2016 The Apache Software Foundation. All rights reserved.