pp.setSystemIncludePath(systemInclude);
cpp.addMacro(macro.getName(), macro.getValue()); if (systemincludepath != null) cpp.setSystemIncludePath(Arrays.asList(systemincludepath.list())); if (localincludepath != null) cpp.setQuoteIncludePath(Arrays.asList(localincludepath.list()));
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); } }
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(); }
public List<String> run() throws SoShaderException { try { final SoShaderPreprocessorJCPP p = SoShaderPreprocessorJCPP.this; this.pp.setSystemIncludePath(p.modules); this.pp.setFileSystem(p.filesystem); this.pp.addInput(p.filesystem.getFile(this.file).getSource()); this.pp.setListener(this); this.setupDefines(); final int bsize = 2 << 14; try (final ByteArrayOutputStream bao = new ByteArrayOutputStream(bsize)) { this.processTokens(bao); return this.processLines(bao); } } catch (final IOException e) { throw new SoShaderExceptionIO(e); } }