JDK 11 jdk.scripting.nashorn.jmod - Scripting Nashorn Module

JDK 11 jdk.scripting.nashorn.jmod is the JMOD file for JDK 11 Scripting Nashorn module.

JDK 11 Scripting Nashorn module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.scripting.nashorn.jmod.

JDK 11 Scripting Nashorn module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 Scripting Nashorn module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.scripting.nashorn.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

jdk/nashorn/internal/runtime/regexp/RegExp.java

/*
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package jdk.nashorn.internal.runtime.regexp;

import java.util.regex.MatchResult;
import jdk.nashorn.internal.runtime.BitVector;
import jdk.nashorn.internal.runtime.ECMAErrors;
import jdk.nashorn.internal.runtime.ParserException;

/**
 * This is the base class for representing a parsed regular expression.
 *
 * Instances of this class are created by a {@link RegExpFactory}.
 */
public abstract class RegExp {

    /** Pattern string. */
    private final String source;

    /** Global search flag for this regexp.*/
    private boolean global;

    /** Case insensitive flag for this regexp */
    private boolean ignoreCase;

    /** Multi-line flag for this regexp */
    private boolean multiline;

    /** BitVector that keeps track of groups in negative lookahead */
    protected BitVector groupsInNegativeLookahead;

    /**
     * Constructor.
     *
     * @param source the source string
     * @param flags the flags string
     */
    protected RegExp(final String source, final String flags) {
        this.source = source.length() == 0 ? "(?:)" : source;
        for (int i = 0; i < flags.length(); i++) {
            final char ch = flags.charAt(i);
            switch (ch) {
            case 'g':
                if (this.global) {
                    throwParserException("repeated.flag", "g");
                }
                this.global = true;
                break;
            case 'i':
                if (this.ignoreCase) {
                    throwParserException("repeated.flag", "i");
                }
                this.ignoreCase = true;
                break;
            case 'm':
                if (this.multiline) {
                    throwParserException("repeated.flag", "m");
                }
                this.multiline = true;
                break;
            default:
                throwParserException("unsupported.flag", Character.toString(ch));
            }
        }
    }

    /**
     * Get the source pattern of this regular expression.
     *
     * @return the source string
     */
    public String getSource() {
        return source;
    }

    /**
     * Set the global flag of this regular expression to {@code global}.
     *
     * @param global the new global flag
     */
    public void setGlobal(final boolean global) {
        this.global = global;
    }

    /**
     * Get the global flag of this regular expression.
     *
     * @return the global flag
     */
    public boolean isGlobal() {
        return global;
    }

    /**
     * Get the ignore-case flag of this regular expression.
     *
     * @return the ignore-case flag
     */
    public boolean isIgnoreCase() {
        return ignoreCase;
    }

    /**
     * Get the multiline flag of this regular expression.
     *
     * @return the multiline flag
     */
    public boolean isMultiline() {
        return multiline;
    }

    /**
     * Get a bitset indicating which of the groups in this regular expression are inside a negative lookahead.
     *
     * @return the groups-in-negative-lookahead bitset
     */
    public BitVector getGroupsInNegativeLookahead() {
        return groupsInNegativeLookahead;
    }

    /**
     * Match this regular expression against {@code str}, starting at index {@code start}
     * and return a {@link MatchResult} with the result.
     *
     * @param str the string
     * @return the matcher
     */
    public abstract RegExpMatcher match(String str);

    /**
     * Throw a regexp parser exception.
     *
     * @param key the message key
     * @param str string argument
     * @throws jdk.nashorn.internal.runtime.ParserException unconditionally
     */
    protected static void throwParserException(final String key, final String str) throws ParserException {
        throw new ParserException(ECMAErrors.getMessage("parser.error.regex." + key, str));
    }
}

jdk/nashorn/internal/runtime/regexp/RegExp.java

 

Or download all of them as a single archive file:

File name: jdk.scripting.nashorn-11.0.1-src.zip
File size: 1390965 bytes
Release date: 2018-11-04
Download 

 

JDK 11 jdk.scripting.nashorn.shell.jmod - Scripting Nashorn Shell Module

JDK 11 jdk.rmic.jmod - RMI Compiler Tool

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-04-25, ≈219🔥, 0💬