All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.parser.clang.CPPComment Maven / Gradle / Ivy

package org.unlaxer.parser.clang;

import java.util.List;

import org.unlaxer.Name;
import org.unlaxer.parser.ChainParsers;
import org.unlaxer.parser.Parser;
import org.unlaxer.parser.combinator.Choice;
import org.unlaxer.parser.combinator.LazyChain;
import org.unlaxer.parser.elementary.EndOfSourceParser;
import org.unlaxer.parser.elementary.WordParser;

public class CPPComment extends LazyChain{

  // parser for // comment
  public CPPComment() {
    super();
  }

  public CPPComment(Name name) {
    super(name);
  }
  
  @Override
  public List getLazyParsers() {
    return new ChainParsers(
      new WordParser("//"),
      new Choice(
          Parser.get(EndOfSourceParser.class)//,
//          Parser.get(LineTerminator.class)
      )
    );
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy