Examples of Lexer


Examples of org.apache.jackrabbit.spi.commons.nodetype.compact.Lexer

     * @param r
     * @throws ParseException
     */
    public CompactNodeTypeDefReader(Reader r, String systemId, NamespaceMapping mapping)
            throws ParseException {
        lexer = new Lexer(r, systemId);
        this.nsMapping = mapping;
        this.resolver = new DefaultNamePathResolver(nsMapping);
        valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);

        nextToken();
View Full Code Here

Examples of org.apache.jackrabbit.vault.fs.impl.io.legacycnd.Lexer

    private Map<String, String> oldMappings = new HashMap<String, String>();

    public ImportInfoImpl doImport(Node parent, String name, Reader r, String systemId)
            throws RepositoryException {
        try {
            lexer = new Lexer(r, systemId);
            nextToken();
            ImportInfoImpl info = parse(parent, name);
            // reset name spaces
            for (String prefix: oldMappings.keySet()) {
                String uri = oldMappings.get(prefix);
View Full Code Here

Examples of org.eclipse.xtext.parser.antlr.Lexer

    StringBuilder builder = new StringBuilder();
    for (Pair<String, String> token : tokens) {
      builder.append(token.getSecond());
    }
    System.out.println("'"+builder+"'");
    Lexer lexer = newLexer();
    lexer.setCharStream(new ANTLRStringStream(builder.toString()));
    for (Pair<String, String> pair : tokens) {
      CommonToken t = (CommonToken) lexer.nextToken();
      String actual = tokenDefProvider().getTokenDefMap().get(t.getType());
      System.out.println(actual+" :"+t.getText());
      assertEquals(pair.toString(),pair.getFirst(), actual);
      assertEquals(pair.toString(),pair.getSecond(), t.getText());
    }
View Full Code Here

Examples of org.exolab.castor.jdo.oql.Lexer

        if (oql.startsWith("CALL ")) {
            createCall(oql);
            return;
        }

        Lexer lexer = new Lexer(oql);
        Parser parser = new Parser(lexer);
        ParseTreeNode parseTree = parser.getParseTree();

        _dbEngine = ((AbstractDatabaseImpl) _database).getLockEngine();
        if (_dbEngine == null) {
View Full Code Here

Examples of org.htmlparser.lexer.Lexer

    }

    // Using HTMLParser to extract the content
    String cleanedContent = null;
    Page htmlPage = new Page(cuttedContent, "UTF-8");
    Parser parser = new Parser(new Lexer(htmlPage));
    StringBean stringBean = new StringBean();

    // replace multiple whitespace with one whitespace
    stringBean.setCollapse(true);
    // Do not extract URLs
    stringBean.setLinks(false);
    // replace &nbsp; with whitespace
    stringBean.setReplaceNonBreakingSpaces(true);

    try {
      // Parse the content
      parser.visitAllNodesWith(stringBean);
      cleanedContent = stringBean.getStrings();

    } catch (ParserException ex) {
      throw new RegainException("Error while parsing content: ", ex);
    }

    // The result of parsing the html-content
    setCleanedContent(cleanedContent);

    // Extract links
    LinkVisitor linkVisitor = new LinkVisitor();
    if (isContentCutted) {
      // This means a new parser run which is expensive but neccessary
      htmlPage = new Page(rawDocument.getContentAsString(), "UTF-8");
      parser = new Parser(new Lexer(htmlPage));
    } else {
      parser.reset();
    }

    try {
View Full Code Here

Examples of org.htmlparser.lexer.Lexer

    @Override
    protected String toString(Object o,
            ResourcePropertyMapping resourcePropertyMapping,
            MarshallingContext context) {
        String str = (String) o;
        Lexer l = new Lexer(str);
        Parser parser = new Parser(l);
        StringBean sb = new StringBean();

        try {
            parser.visitAllNodesWith(sb);
View Full Code Here

Examples of org.htmlparser.lexer.Lexer

            String s;
            while ((s = br.readLine()) != null) {
                stringBuilder.append(s);
            }

            Lexer l = new Lexer(stringBuilder.toString());
            Parser parser = new Parser(l);
            StringBean sb = new StringBean();

            parser.visitAllNodesWith(sb);
View Full Code Here

Examples of org.htmlparser.lexer.Lexer

        try {
            page = new Page(in, null);
        } catch (final UnsupportedEncodingException e) {
            throw new ScimpiException(e);
        }
        final Lexer lexer = new Lexer(page);

        Node node = null;
        try {
            Stack<Snippet> tags = allTags;
            String lineNumbers = "1";
            String template = null;
            tags.push(new HtmlSnippet(lineNumbers, filePath));

            // NOTE done like this the tags can be cached for faster processing
            while ((node = lexer.nextNode()) != null) {
                if (node instanceof Remark) {
                    // TODO need to pick up on comments within tags; at the
                    // moment this splits a tag into two causing a
                    // failure later
                    continue;
View Full Code Here

Examples of org.jbehave.core.story.codegen.sablecc.lexer.Lexer


public class TextStoryParser implements StoryParser {
  public StoryDetails parseStory(Reader in) {
    try {
      Lexer lexer = new Lexer(new PushbackReader(in, 1024));
      Parser parser = new Parser(lexer);
      Start root = parser.parse();
      StoryDetailsBuilder builder = new StoryDetailsBuilder();
      root.apply(builder);
      return builder.getStoryDetails();
View Full Code Here

Examples of org.jrdf.sparql.parser.lexer.Lexer

    public Parser getParser(String queryText) {
        checkNotEmptyString("queryText", queryText);
        StringReader in = new StringReader(queryText);
        reader = new PushbackReader(in, PUSHBACK_BUFFER_SIZE);
        Lexer lexer = new Lexer(reader);
        return new Parser(lexer);
    }
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.