Examples of ParserResult


Examples of net.sf.jabref.imports.ParserResult

                    }
                    String[] args = sb.toString().split("\n");
                    Vector<ParserResult> loaded = jabref.processArguments(args, false);

                    for (int i=0; i<loaded.size(); i++) {
                        ParserResult pr = loaded.elementAt(i);
                        if (!pr.toOpenTab()) {
                            jabref.jrf.addTab(pr.getDatabase(), pr.getFile(), pr.getMetaData(), pr.getEncoding(), (i == 0));
                        } else {
                            // Add the entries to the open tab.
                            BasePanel panel = jabref.jrf.basePanel();
                            if (panel == null) {
                                // There is no open tab to add to, so we create a new tab:
                                jabref.jrf.addTab(pr.getDatabase(), pr.getFile(), pr.getMetaData(), pr.getEncoding(), (i == 0));
                            } else {
                                List<BibtexEntry> entries = new ArrayList<BibtexEntry>(pr.getDatabase().getEntries());
                                jabref.jrf.addImportedEntries(panel, entries, "", false);
                            }
                        }
                    }
                    in.close();
View Full Code Here

Examples of org.auraframework.impl.css.parser.CssPreprocessor.ParserResult

            builder.setDescriptor(styleDefDesc);
            builder.setLocation(source.getSystemId(), source.getLastModified());
            builder.setClassName(className);
            builder.setOwnHash(source.getHash());

            ParserResult result = CssPreprocessor
                    .initial()
                    .source(source.getContents())
                    .resourceName(source.getSystemId())
                    .componentClass(className, shouldValidate(descriptor.getName()))
                    .allowedConditions(allowedConditions)
                    .themes(styleDefDesc)
                    .parse();

            builder.setContent(result.content());
            builder.setThemeExpressions(result.themeExpressions());

            return (D) builder.build();
        } else if (descriptor.getDefType() == DefType.RESOURCE) {
            return (D) new ResourceDefHandler<ResourceDef>((DefDescriptor<ResourceDef>) descriptor,
                    (Source<ResourceDef>) source).createDefinition();
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

        try {
            ParserManager.parse(Collections.singleton(Source.create(controller)), new UserTask() {
                @Override
                public void run(ResultIterator resultIterator) throws Exception {
                    ParserResult parserResult = (ParserResult) resultIterator.getParserResult();
                    final YiiControllerVisitor controllerVisitor = new YiiControllerVisitor(view);
                    controllerVisitor.scan(Utils.getRoot(parserResult));
                    phpVariables.addAll(controllerVisitor.getPhpVariables());
                }
            });
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

                    // get offset for massage
                    try {
                        ParserManager.parse(Collections.singleton(Source.create(messageFile)), new UserTask() {
                            @Override
                            public void run(ResultIterator resultIterator) throws Exception {
                                ParserResult parseResult = (ParserResult) resultIterator.getParserResult();
                                if (parseResult == null) {
                                    return;
                                }
                                final MessageVisitor messageVisitor = new MessageVisitor(messageKey);
                                messageVisitor.scan(Utils.getRoot(parseResult));
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

                @Override
                public void run(ResultIterator resultIterator) throws Exception {
                    if (resultIterator == null) {
                        return;
                    }
                    ParserResult parserResult = (ParserResult) resultIterator.getParserResult();
                    ControllerMethodVisitor visitor = new ControllerMethodVisitor(methodName);
                    visitor.scan(Utils.getRoot(parserResult));
                    params.addAll(visitor.getParams());
                }
            });
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

                @Override
                public void run(ResultIterator resultIterator) throws Exception {
                    if (resultIterator == null) {
                        return;
                    }
                    ParserResult parserResult = (ParserResult) resultIterator.getParserResult();
                    final MainVisitor mainVisitor = new MainVisitor();
                    mainVisitor.scan(Utils.getRoot(parserResult));
                    themes.addAll(mainVisitor.getThemeName());
                }
            });
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

    @Override
    public List<CompletionProposal> complete(CodeCompletionContext ccContext, CompletionContext jsCompletionContext, String prefix) {
        long start = System.currentTimeMillis();
        List<CompletionProposal> result = new ArrayList<>();
        ParserResult parserResult = ccContext.getParserResult();
        int offset = ccContext.getCaretOffset();
        lastTsOffset = ccContext.getParserResult().getSnapshot().getEmbeddedOffset(offset);
        switch (jsCompletionContext) {
            case STRING:
            case GLOBAL:
View Full Code Here

Examples of org.netbeans.modules.csl.spi.ParserResult

    protected void scan(final DefaultVisitor visitor, FileObject targetFile) throws ParseException {
        ParserManager.parse(Collections.singleton(Source.create(targetFile)), new UserTask() {
            @Override
            public void run(ResultIterator resultIterator) throws Exception {
                ParserResult parseResult = (ParserResult) resultIterator.getParserResult();
                visitor.scan(Utils.getRoot(parseResult));
            }
        });
    }
View Full Code Here

Examples of slash.navigation.base.ParserResult

        System.exit(0);
    }

    private void convert(File source, NavigationFormat format, File target) throws IOException {
        NavigationFormatParser parser = new NavigationFormatParser();
        ParserResult result = parser.read(source);
        if (!result.isSuccessful()) {
            log.severe("Could not read source '" + source.getAbsolutePath() + "'");
            logFormatNames(getReadFormatsSortedByName());
            System.exit(20);
        }

        if (format.isSupportsMultipleRoutes()) {
            parser.write(result.getAllRoutes(), (MultipleRoutesFormat) format, target);
        } else {
            int fileCount = getNumberOfFilesToWriteFor(result.getTheRoute(), format, false);
            File[] targets = createTargetFiles(target, fileCount, format.getExtension(), format.getMaximumFileNameLength());
            for (File t : targets) {
                if (t.exists()) {
                    log.severe("Target '" + t.getAbsolutePath() + "' already exists; stopping.");
                    System.exit(13);
                }
            }
            parser.write(result.getTheRoute(), format, false, false, null, targets);
        }
    }
View Full Code Here

Examples of slash.navigation.base.ParserResult

public class ZipFormatIT {
    private NavigationFormatParser parser = new NavigationFormatParser();

    @Test
    public void readGPX11Archive() throws IOException {
        ParserResult result = parser.read(new File(TEST_PATH + "from-gpx11.zip"));
        assertNotNull(result);
        assertEquals(4, result.getAllRoutes().size());
        assertEquals(Gpx11Format.class, result.getFormat().getClass());
    }
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.