Examples of ParseResult


Examples of ch.njol.skript.lang.SkriptParser.ParseResult

          one[0] = o;
          return one;
        }
      } else {
        assert pattern != null && plurals != null;
        final ParseResult r = SkriptParser.parse(t, pattern);
        if (r != null) {
          assert plurals.length == r.exprs.length;
          final Object[] os = new Object[r.exprs.length];
          for (int i = 0; i < os.length; i++)
            os[i] = plurals[i] ? r.exprs[i].getArray(null) : r.exprs[i].getSingle(null);
View Full Code Here

Examples of cn.edu.hfut.dmic.webcollector.parser.ParseResult

                        if (parsing) {
                            try {
                                Parser parser = parserFactory.createParser(url, contentType);
                                if (parser != null) {
                                    ParseResult parseresult = parser.getParse(page);
                                    page.setParseResult(parseresult);
                                }
                            } catch (Exception ex) {
                                LogUtils.getLogger().info("Exception", ex);
                            }
View Full Code Here

Examples of com.bradmcevoy.http.webdav.PropFindRequestFieldParser.ParseResult

            "<R:author/> " +
            "</D:prop> " +
            "</D:propfind>";

        InputStream in = new ByteArrayInputStream( xml.getBytes());
        ParseResult parseResult = fieldParser.getRequestedFields( in );
        Set<QName> set = parseResult.getNames();
        assertEquals( 1, set.size());
        QName qn = set.iterator().next();
        assertEquals( "http://ns.example.com/boxschema/", qn.getNamespaceURI());
        assertEquals( "author", qn.getLocalPart());
    }
View Full Code Here

Examples of com.bradmcevoy.http.webdav.PropPatchRequestParser.ParseResult

            }
            log.debug( "field: " + qn );
            fields.put( qn, sFieldValue );
        }

        ParseResult parseResult = new ParseResult( fields, null );

        if( log.isTraceEnabled() ) {
            log.trace( "check permissions with: " + permissionService.getClass() );
        }
        Set<PropertyAuthoriser.CheckResult> errorFields = permissionService.checkPermissions( HttpManager.request(), Method.PROPPATCH, PropertyAuthoriser.PropertyPermission.WRITE, fields.keySet(), wrappedResource );
View Full Code Here

Examples of com.creativewidgetworks.goldparser.engine.enums.ParseResult

                } else if (SymbolType.END.equals(read.getType()) && groupStack.size() > 0) {
                    // Runaway group
                    parseMessage = ParseMessage.GROUP_ERROR;
                    done = true;                   
                } else {
                    ParseResult parseResult = parseLALR(read)// Same method as v1
                    switch (parseResult) {
                        case ACCEPT:
                            parseMessage = ParseMessage.ACCEPT;
                            done = true;
                            break;
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.parser.ParseResult

    }

    public ParseResult parse(@NotNull ParsePathNode parentNode, boolean optional, int depth, ParserContext context) throws ParseException {
        ParserBuilder builder = context.getBuilder();
        PsiBuilder.Marker marker = builder.mark(null);
        ParseResult result = super.parse(parentNode, optional, depth, context);
        if (result.getType() == ParseResultType.NO_MATCH) {
            builder.markerDrop(marker);
        } else {
            builder.markerDone(marker, getElementType());
        }
        return result.getType() == ParseResultType.NO_MATCH ?
                ParseResult.createNoMatchResult() :
                ParseResult.createFullMatchResult(result.getMatchedTokens());
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.parser.ParseResult

                            elementType.isOptional(index) && (elementType.isLast(index) || elementType.isOptionalFromIndex(index)) ? ParseResultType.FULL_MATCH :
                            !elementType.isFirst(index) && !elementType.isOptionalFromIndex(index) && !elementType.isExitIndex(index) ? ParseResultType.PARTIAL_MATCH : ParseResultType.NO_MATCH;
                    return stepOut(marker, depth, resultType, matchedTokens, node, context);
                }

                ParseResult result = ParseResult.createNoMatchResult();
                // current token can still be part of the iterated element.
                //if (elementTypes[i].containsToken(tokenType)) {
                if (isDummyToken || elementTypes[index].getLookupCache().canStartWithToken(tokenType) || isSuppressibleReservedWord(tokenType, node)) {

                    //node = node.createVariant(builder.getCurrentOffset(), i);
                    result = elementTypes[index].getParser().parse(node, elementType.isOptional(index), depth + 1, context);

                    if (result.isMatch()) {
                        matchedTokens = matchedTokens + result.getMatchedTokens();
                        tokenType = builder.getTokenType();
                        isDummyToken = isDummyToken(builder.getTokenText());
                        matches++;
                    }
                }

                // not matched and not optional
                if (result.isNoMatch() && !elementType.isOptional(index)) {
                    boolean isWeakMatch = matches < 2 && matchedTokens < 3 && index > 1 && ignoreFirstMatch();
                   
                    if (elementType.isFirst(index) || elementType.isExitIndex(index) || isWeakMatch || matches == 0) {
                        //if (isFirst(i) || isExitIndex(i)) {
                        return stepOut(marker, depth, ParseResultType.NO_MATCH, matchedTokens, node, context);
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.parser.ParseResult

        if (variant != null) {
            LeafElementType[] elementTypes = variant.getLeafs();

            int currentSiblingPosition = 0;
            for (LeafElementType elementType : elementTypes) {
                ParseResult result = elementType.getParser().parse(node, true, depth + 1, context);
                if (result.isNoMatch()) breakelse matchedTokens = matchedTokens + result.getMatchedTokens();

                if (elementType != elementTypes[elementTypes.length -1])  {
                    result = separatorToken.getParser().parse(node, true, depth + 1, context);
                    if (result.isNoMatch()) break; else matchedTokens = matchedTokens + result.getMatchedTokens();
                }
                node.incrementIndex(builder.getCurrentOffset());
            }

            if (variant.isIncomplete()) {
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.parser.ParseResult

        if (tokenType!= null && !tokenType.isChameleon()) {
            String tokenText = builder.getTokenText();
            // TODO !!!! if elementType is an identifier: then BUILD VARIANTS!!!
            for (ElementType elementType : getElementType().getPossibleElementTypes()) {
                if (isDummyToken(tokenText) || elementType.getLookupCache().canStartWithToken(tokenType) || isSuppressibleReservedWord(tokenType, node)) {
                    ParseResult result = elementType.getParser().parse(node, true, depth + 1, context);
                    if (result.isMatch()) {
                        return stepOut(marker, depth, result.getType(), result.getMatchedTokens(), node, context);
                    }
                }
            }
            if (!optional) {
                //updateBuilderError(builder, this);
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.parser.ParseResult

        int matchedTokens = 0;
        boolean isWrapped = false;

        // first try to parse the wrapped element directly, for supporting wrapped elements nesting
        if (isWrappingOptional) {
            ParseResult wrappedResult = wrappedElement.getParser().parse(node, optional, depth + 1, context);
            if (wrappedResult.isMatch()) {
                matchedTokens = matchedTokens + wrappedResult.getMatchedTokens();
                return stepOut(marker, depth, wrappedResult.getType(), matchedTokens, node, context);
            } else {
                builder.markerRollbackTo(marker, null);
                marker = builder.mark(null);
            }
        }

        // parse begin token
        ParseResult beginTokenResult = beginTokenElement.getParser().parse(node, optional, depth + 1, context);

        if (beginTokenResult.isMatch()) {
            isWrapped = true;
            matchedTokens++;
        }

        if (beginTokenResult.isMatch() || isWrappingOptional) {
            ParseResult wrappedResult = wrappedElement.getParser().parse(node, false, depth -1, context);
            matchedTokens = matchedTokens + wrappedResult.getMatchedTokens();

            if (isWrapped) {
                // check the end element => exit with partial match if not available
                ParseResult endTokenResult = endTokenElement.getParser().parse(node, false, depth -1, context);
                if (endTokenResult.isMatch()) {
                    matchedTokens++;
                    return stepOut(marker, depth, ParseResultType.FULL_MATCH, matchedTokens, node, context);
                } else {
                    return stepOut(marker, depth, wrappedResult.getType(), matchedTokens, node, context);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.