Java 类jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit 实例源码

项目:OpenJSharp    文件:ReplaceCompileUnits.java   
@Override
public Node leaveLiteralNode(final LiteralNode<?> node) {
    if (node instanceof ArrayLiteralNode) {
        final ArrayLiteralNode aln = (ArrayLiteralNode)node;
        if (aln.getUnits() == null) {
            return node;
        }
        final List<ArrayUnit> newArrayUnits = new ArrayList<>();
        for (final ArrayUnit au : aln.getUnits()) {
            newArrayUnits.add(new ArrayUnit(getExistingReplacement(au), au.getLo(), au.getHi()));
        }
        return aln.setUnits(lc, newArrayUnits);
    }
    return node;
}
项目:OpenJSharp    文件:AssignSymbols.java   
private static boolean isSplitArray(final LexicalContextNode expr) {
    if(!(expr instanceof ArrayLiteralNode)) {
        return false;
    }
    final List<ArrayUnit> units = ((ArrayLiteralNode)expr).getUnits();
    return !(units == null || units.isEmpty());
}
项目:OpenJSharp    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}
项目:kaziranga    文件:ReplaceCompileUnits.java   
@Override
public Node leaveLiteralNode(final LiteralNode<?> node) {
    if (node instanceof ArrayLiteralNode) {
        final ArrayLiteralNode aln = (ArrayLiteralNode)node;
        if (aln.getUnits() == null) {
            return node;
        }
        final List<ArrayUnit> newArrayUnits = new ArrayList<>();
        for (final ArrayUnit au : aln.getUnits()) {
            newArrayUnits.add(new ArrayUnit(getExistingReplacement(au), au.getLo(), au.getHi()));
        }
        return aln.setUnits(lc, newArrayUnits);
    }
    return node;
}
项目:kaziranga    文件:AssignSymbols.java   
private static boolean isSplitArray(final LexicalContextNode expr) {
    if(!(expr instanceof ArrayLiteralNode)) {
        return false;
    }
    final List<ArrayUnit> units = ((ArrayLiteralNode)expr).getUnits();
    return !(units == null || units.isEmpty());
}
项目:kaziranga    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}
项目:infobip-open-jdk-8    文件:ReplaceCompileUnits.java   
@Override
public Node leaveLiteralNode(final LiteralNode<?> node) {
    if (node instanceof ArrayLiteralNode) {
        final ArrayLiteralNode aln = (ArrayLiteralNode)node;
        if (aln.getUnits() == null) {
            return node;
        }
        final List<ArrayUnit> newArrayUnits = new ArrayList<>();
        for (final ArrayUnit au : aln.getUnits()) {
            newArrayUnits.add(new ArrayUnit(getExistingReplacement(au), au.getLo(), au.getHi()));
        }
        return aln.setUnits(lc, newArrayUnits);
    }
    return node;
}
项目:infobip-open-jdk-8    文件:AssignSymbols.java   
private static boolean isSplitArray(final LexicalContextNode expr) {
    if(!(expr instanceof ArrayLiteralNode)) {
        return false;
    }
    final List<ArrayUnit> units = ((ArrayLiteralNode)expr).getUnits();
    return !(units == null || units.isEmpty());
}
项目:infobip-open-jdk-8    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}
项目:OLD-OpenJDK8    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}
项目:nashorn-backport    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}
项目:nashorn    文件:WeighNodes.java   
@SuppressWarnings("rawtypes")
@Override
public boolean enterLiteralNode(final LiteralNode literalNode) {
    weight += LITERAL_WEIGHT;

    if (literalNode instanceof ArrayLiteralNode) {
        final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
        final Node[]           value            = arrayLiteralNode.getValue();
        final int[]            postsets         = arrayLiteralNode.getPostsets();
        final List<ArrayUnit>  units            = arrayLiteralNode.getUnits();

        if (units == null) {
            for (final int postset : postsets) {
                weight += AASTORE_WEIGHT;
                final Node element = value[postset];

                if (element != null) {
                    element.accept(this);
                }
            }
        }

        return false;
    }

    return true;
}