Tabnine Logo
CppReader.getPreprocessor
Code IndexAdd Tabnine to your IDE (free)

How to use
getPreprocessor
method
in
org.anarres.cpp.CppReader

Best Java code snippets using org.anarres.cpp.CppReader.getPreprocessor (Showing top 3 results out of 315)

origin: nativelibs4java/JNAerator

private void testCppReader(String in, String out)
          throws Exception {
  System.out.println("Testing " + in + " => " + out);
  StringReader    r = new StringReader(in);
  CppReader        p = new CppReader(r);
  p.getPreprocessor().setSystemIncludePath(
      Collections.singletonList("src/test/resources/input")
        );
  p.getPreprocessor().getFeatures().add(Feature.LINEMARKERS);
  BufferedReader    b = new BufferedReader(p);
  String    line;
  while ((line = b.readLine()) != null) {
    System.out.println(" >> " + line);
  }
}
origin: shevek/jcpp

public static String testCppReader(@Nonnull String in, Feature... f)
    throws Exception {
  System.out.println("Testing " + in);
  StringReader r = new StringReader(in);
  CppReader p = new CppReader(r);
  p.getPreprocessor().setSystemIncludePath(
      Collections.singletonList("src/test/resources")
  );
  p.getPreprocessor().addFeatures(f);
  BufferedReader b = new BufferedReader(p);
  StringBuilder out = new StringBuilder();
  String line;
  while ((line = b.readLine()) != null) {
    System.out.println(" >> " + line);
    out.append(line).append("\n");
  }
  return out.toString();
}
origin: shevek/jcpp

  @Test
  public void testPragma() throws Exception {
    File file = new File("build/resources/test/pragma.c");
    assertTrue(file.exists());

    CharSource source = Files.asCharSource(file, Charsets.UTF_8);
    CppReader r = new CppReader(source.openBufferedStream());
    r.getPreprocessor().setListener(new DefaultPreprocessorListener());
    String output = CharStreams.toString(r);
    r.close();
    LOG.info("Output: " + output);
    // assertTrue(output.contains("absolute-result"));
  }
}
org.anarres.cppCppReadergetPreprocessor

Javadoc

Returns the Preprocessor used by this CppReader.

Popular methods of CppReader

  • <init>
  • read
  • refill
  • close

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Path (java.nio.file)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now