• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Namespace类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中jdk.nashorn.internal.codegen.Namespace的典型用法代码示例。如果您正苦于以下问题:Java Namespace类的具体用法?Java Namespace怎么用?Java Namespace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Namespace类属于jdk.nashorn.internal.codegen包,在下文中一共展示了Namespace类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Parser

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Construct a parser.
 *
 * @param env     script environment
 * @param source  source to parse
 * @param errors  error manager
 * @param strict  parser created with strict mode enabled.
 * @param lineOffset line offset to start counting lines from
 * @param log debug logger if one is needed
 */
public Parser(final ScriptEnvironment env, final Source source, final ErrorManager errors, final boolean strict, final int lineOffset, final DebugLogger log) {
    super(source, errors, strict, lineOffset);
    this.env = env;
    this.namespace = new Namespace(env.getNamespace());
    this.scripting = env._scripting;
    if (this.scripting) {
        this.lineInfoReceiver = new Lexer.LineInfoReceiver() {
            @Override
            public void lineInfo(final int receiverLine, final int receiverLinePosition) {
                // update the parser maintained line information
                Parser.this.line = receiverLine;
                Parser.this.linePosition = receiverLinePosition;
            }
        };
    } else {
        // non-scripting mode script can't have multi-line literals
        this.lineInfoReceiver = null;
    }

    this.log = log == null ? DebugLogger.DISABLED_LOGGER : log;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:Parser.java


示例2: initializeDeserialized

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Sets the source and namespace for this function. It can only set a non-null source and namespace for a function
 * that currently has both a null source and a null namespace. This is used to re-set the source and namespace for
 * a deserialized function node.
 * @param source the source for the function.
 * @param namespace the namespace for the function
 * @return a new function node with the set source and namespace
 * @throws IllegalArgumentException if the specified source or namespace is null
 * @throws IllegalStateException if the function already has either a source or namespace set.
 */
public FunctionNode initializeDeserialized(final Source source, final Namespace namespace) {
    if (source == null || namespace == null) {
        throw new IllegalArgumentException();
    } else if (this.source == source && this.namespace == namespace) {
        return this;
    } else if (this.source != null || this.namespace != null) {
        throw new IllegalStateException();
    }
    return new FunctionNode(
        this,
        lastToken,
        endParserState,
        flags,
        name,
        returnType,
        compileUnit,
        compilationState,
        body,
        parameters,
        thisProperties,
        rootClass, source, namespace);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:FunctionNode.java


示例3: Parser

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Construct a parser.
 *
 * @param env     script environment
 * @param source  source to parse
 * @param errors  error manager
 * @param strict  parser created with strict mode enabled.
 * @param lineOffset line offset to start counting lines from
 * @param log debug logger if one is needed
 */
public Parser(final ScriptEnvironment env, final Source source, final ErrorManager errors, final boolean strict, final int lineOffset, final DebugLogger log) {
    super(source, errors, strict, lineOffset);
    this.lc = new ParserContext();
    this.defaultNames = new ArrayDeque<>();
    this.env = env;
    this.namespace = new Namespace(env.getNamespace());
    this.scripting = env._scripting;
    if (this.scripting) {
        this.lineInfoReceiver = new Lexer.LineInfoReceiver() {
            @Override
            public void lineInfo(final int receiverLine, final int receiverLinePosition) {
                // update the parser maintained line information
                Parser.this.line = receiverLine;
                Parser.this.linePosition = receiverLinePosition;
            }
        };
    } else {
        // non-scripting mode script can't have multi-line literals
        this.lineInfoReceiver = null;
    }

    this.log = log == null ? DebugLogger.DISABLED_LOGGER : log;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:Parser.java


示例4: initializeDeserialized

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Sets the source and namespace for this function. It can only set a non-null source and namespace for a function
 * that currently has both a null source and a null namespace. This is used to re-set the source and namespace for
 * a deserialized function node.
 * @param source the source for the function.
 * @param namespace the namespace for the function
 * @return a new function node with the set source and namespace
 * @throws IllegalArgumentException if the specified source or namespace is null
 * @throws IllegalStateException if the function already has either a source or namespace set.
 */
public FunctionNode initializeDeserialized(final Source source, final Namespace namespace) {
    if (source == null || namespace == null) {
        throw new IllegalArgumentException();
    } else if (this.source == source && this.namespace == namespace) {
        return this;
    } else if (this.source != null || this.namespace != null) {
        throw new IllegalStateException();
    }
    return new FunctionNode(
        this,
        lastToken,
        endParserState,
        flags,
        name,
        returnType,
        compileUnit,
        body,
        parameters,
        thisProperties,
        rootClass, source, namespace);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:FunctionNode.java


示例5: Parser

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Construct a parser.
 *
 * @param env     script environment
 * @param source  source to parse
 * @param errors  error manager
 * @param strict  parser created with strict mode enabled.
 */
public Parser(final ScriptEnvironment env, final Source source, final ErrorManager errors, final boolean strict) {
    super(source, errors, strict);
    this.env       = env;
    this.namespace = new Namespace(env.getNamespace());
    this.scripting = env._scripting;
    if (this.scripting) {
        this.lineInfoReceiver = new Lexer.LineInfoReceiver() {
            @Override
            public void lineInfo(final int receiverLine, final int receiverLinePosition) {
                // update the parser maintained line information
                Parser.this.line = receiverLine;
                Parser.this.linePosition = receiverLinePosition;
            }
        };
    } else {
        // non-scripting mode script can't have multi-line literals
        this.lineInfoReceiver = null;
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:28,代码来源:Parser.java


示例6: deserialize

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
private FunctionNode deserialize() {
    final ScriptEnvironment env = installer.getOwner();
    final Timing timing = env._timing;
    final long t1 = System.nanoTime();
    try {
        return AstDeserializer.deserialize(serializedAst).initializeDeserialized(source, new Namespace(env.getNamespace()));
    } finally {
        timing.accumulateTime("'Deserialize'", System.nanoTime() - t1);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:RecompilableScriptFunctionData.java


示例7: FunctionNode

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param source     the source
 * @param lineNumber line number
 * @param token      token
 * @param finish     finish
 * @param firstToken first token of the function node (including the function declaration)
 * @param namespace  the namespace
 * @param ident      the identifier
 * @param name       the name of the function
 * @param parameters parameter list
 * @param kind       kind of function as in {@link FunctionNode.Kind}
 * @param flags      initial flags
 */
public FunctionNode(
    final Source source,
    final int lineNumber,
    final long token,
    final int finish,
    final long firstToken,
    final Namespace namespace,
    final IdentNode ident,
    final String name,
    final List<IdentNode> parameters,
    final FunctionNode.Kind kind,
    final int flags) {
    super(token, finish);

    this.source           = source;
    this.lineNumber       = lineNumber;
    this.ident            = ident;
    this.name             = name;
    this.kind             = kind;
    this.parameters       = parameters;
    this.firstToken       = firstToken;
    this.lastToken        = token;
    this.namespace        = namespace;
    this.compilationState = EnumSet.of(CompilationState.INITIALIZED);
    this.flags            = flags;
    this.compileUnit      = null;
    this.body             = null;
    this.thisProperties   = 0;
    this.rootClass        = null;
    this.endParserState    = null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:47,代码来源:FunctionNode.java


示例8: ParserContextFunctionNode

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * @param token The token for the function
 * @param ident External function name
 * @param name  Internal name of the function
 * @param namespace Function's namespace
 * @param line  The source line of the function
 * @param kind  Function kind
 * @param parameters The parameters of the function
 */
public ParserContextFunctionNode(final long token, final IdentNode ident, final String name, final Namespace namespace, final int line, final FunctionNode.Kind kind, final List<IdentNode> parameters) {
    this.ident      = ident;
    this.namespace  = namespace;
    this.line       = line;
    this.kind       = kind;
    this.name       = name;
    this.parameters = parameters;
    this.token      = token;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ParserContextFunctionNode.java


示例9: deserialize

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
private FunctionNode deserialize(final byte[] serializedAst) {
    final ScriptEnvironment env = installer.getContext().getEnv();
    final Timing timing = env._timing;
    final long t1 = System.nanoTime();
    try {
        return AstDeserializer.deserialize(serializedAst).initializeDeserialized(source, new Namespace(env.getNamespace()));
    } finally {
        timing.accumulateTime("'Deserialize'", System.nanoTime() - t1);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:RecompilableScriptFunctionData.java


示例10: FunctionNode

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param source     the source
 * @param lineNumber line number
 * @param token      token
 * @param finish     finish
 * @param firstToken first token of the function node (including the function declaration)
 * @param lastToken  lastToken
 * @param namespace  the namespace
 * @param ident      the identifier
 * @param name       the name of the function
 * @param parameters parameter list
 * @param paramExprs the ES6 function parameter expressions
 * @param kind       kind of function as in {@link FunctionNode.Kind}
 * @param flags      initial flags
 * @param body       body of the function
 * @param endParserState The parser state at the end of the parsing.
 * @param module     the module
 * @param debugFlags the debug flags
 */
public FunctionNode(
    final Source source,
    final int lineNumber,
    final long token,
    final int finish,
    final long firstToken,
    final long lastToken,
    final Namespace namespace,
    final IdentNode ident,
    final String name,
    final List<IdentNode> parameters,
    final Map<IdentNode, Expression> paramExprs,
    final FunctionNode.Kind kind,
    final int flags,
    final Block body,
    final Object endParserState,
    final Module module,
    final int debugFlags) {
    super(token, finish);

    this.source           = source;
    this.lineNumber       = lineNumber;
    this.ident            = ident;
    this.name             = name;
    this.kind             = kind;
    this.parameters       = parameters;
    this.parameterExpressions = paramExprs;
    this.firstToken       = firstToken;
    this.lastToken        = lastToken;
    this.namespace        = namespace;
    this.flags            = flags;
    this.compileUnit      = null;
    this.body             = body;
    this.thisProperties   = 0;
    this.rootClass        = null;
    this.endParserState   = endParserState;
    this.module           = module;
    this.debugFlags       = debugFlags;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:61,代码来源:FunctionNode.java


示例11: FunctionNode

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param source     the source
 * @param lineNumber line number
 * @param token      token
 * @param finish     finish
 * @param firstToken first token of the function node (including the function declaration)
 * @param lastToken  lastToken
 * @param namespace  the namespace
 * @param ident      the identifier
 * @param name       the name of the function
 * @param parameters parameter list
 * @param kind       kind of function as in {@link FunctionNode.Kind}
 * @param flags      initial flags
 * @param body       body of the function
 * @param endParserState The parser state at the end of the parsing.
 * @param module     the module
 * @param debugFlags the debug flags
 */
public FunctionNode(
    final Source source,
    final int lineNumber,
    final long token,
    final int finish,
    final long firstToken,
    final long lastToken,
    final Namespace namespace,
    final IdentNode ident,
    final String name,
    final List<IdentNode> parameters,
    final FunctionNode.Kind kind,
    final int flags,
    final Block body,
    final Object endParserState,
    final Module module,
    final int debugFlags) {
    super(token, finish);

    this.source           = source;
    this.lineNumber       = lineNumber;
    this.ident            = ident;
    this.name             = name;
    this.kind             = kind;
    this.parameters       = parameters;
    this.firstToken       = firstToken;
    this.lastToken        = lastToken;
    this.namespace        = namespace;
    this.flags            = flags;
    this.compileUnit      = null;
    this.body             = body;
    this.thisProperties   = 0;
    this.rootClass        = null;
    this.endParserState   = endParserState;
    this.module           = module;
    this.debugFlags       = debugFlags;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:58,代码来源:FunctionNode.java


示例12: FunctionNode

import jdk.nashorn.internal.codegen.Namespace; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param source     the source
 * @param lineNumber line number
 * @param token      token
 * @param finish     finish
 * @param firstToken first token of the function node (including the function declaration)
 * @param namespace  the namespace
 * @param ident      the identifier
 * @param name       the name of the function
 * @param parameters parameter list
 * @param kind       kind of function as in {@link FunctionNode.Kind}
 * @param flags      initial flags
 */
public FunctionNode(
    final Source source,
    final int lineNumber,
    final long token,
    final int finish,
    final long firstToken,
    final Namespace namespace,
    final IdentNode ident,
    final String name,
    final List<IdentNode> parameters,
    final FunctionNode.Kind kind,
    final int flags) {
    super(token, finish);

    this.source           = source;
    this.lineNumber       = lineNumber;
    this.ident            = ident;
    this.name             = name;
    this.kind             = kind;
    this.parameters       = parameters;
    this.firstToken       = firstToken;
    this.lastToken        = token;
    this.namespace        = namespace;
    this.flags            = flags;
    this.compileUnit      = null;
    this.body             = null;
    this.thisProperties   = 0;
    this.rootClass        = null;
    this.endParserState    = null;
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:46,代码来源:FunctionNode.java



注:本文中的jdk.nashorn.internal.codegen.Namespace类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Util类代码示例发布时间:2022-05-22
下一篇:
Java CacheManagerPeerProvider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap