public CppReader(final Reader r) { cpp = new Preprocessor(new LexerSource(r, true) { @Override public String getName() { return "<CppReader Input@" + System.identityHashCode(r) + ">"; } }); token = ""; idx = 0; }
public CppReader(final Reader r) { cpp = new Preprocessor(new LexerSource(r, true) { @Override public String getName() { return "<CppReader Input@" + System.identityHashCode(r) + ">"; } }); token = ""; idx = 0; }
public CppTask() { super(); cpp = new Preprocessor(); }
public CppTask() { super(); cpp = new Preprocessor(); }
public CppReader(@Nonnull final Reader r) { cpp = new Preprocessor(new LexerSource(r, true) { @Override public String getName() { return "<CppReader Input@" + System.identityHashCode(r) + ">"; } }); token = ""; idx = 0; }
Preprocessor pp = new Preprocessor(new File(mainFileName));
public void setUp() throws Exception { final PipedOutputStream po = new PipedOutputStream(); writer = new OutputStreamWriter(po); p = new Preprocessor(); p.addInput( new LexerSource( new InputStreamReader( new PipedInputStream(po) ), true ) ); }
Processor( final Map<String, String> in_defines, final String in_file, final SoShaderPreprocessorCallbackWarningType in_on_warning, final SoShaderPreprocessorCallbackErrorType in_on_error) { this.defines = NullCheck.notNull(in_defines, "Defines"); this.file = NullCheck.notNull(in_file, "file"); this.on_warning = NullCheck.notNull(in_on_warning, "on_warning"); this.on_error = NullCheck.notNull(in_on_error, "on_error"); this.pp = new Preprocessor(); }
@Before public void setUp() throws Exception { final PipedOutputStream po = new PipedOutputStream(); writer = new OutputStreamWriter(po); p = new Preprocessor(); p.addInput( new LexerSource( new InputStreamReader( new PipedInputStream(po) ), true ) ); }
throw new BuildException("Output not specified"); Preprocessor cpp = new Preprocessor(); cpp.setListener(listener); for (Macro macro : macros)
@Test public void testAbsoluteInclude() throws Exception { File file = new File("build/resources/test/absolute.h"); assertTrue(file.exists()); String input = "#include <" + file.getAbsolutePath() + ">\n"; LOG.info("Input: " + input); Preprocessor pp = new Preprocessor(); pp.addInput(new StringLexerSource(input, true)); Reader r = new CppReader(pp); String output = CharStreams.toString(r); r.close(); LOG.info("Output: " + output); assertTrue(output.contains("absolute-result")); } }
@Test public void testWhitespacePasting() throws IOException { Preprocessor pp = new Preprocessor(); pp.addInput(new StringLexerSource( "#define ONE(arg) one_##arg\n" + "#define TWO(arg) ONE(two_##arg)\n" + "\n" + "TWO(good)\n" + "TWO( /* evil newline */\n" + " bad)\n" + "\n" + "ONE(good)\n" + "ONE( /* evil newline */\n" + " bad)\n", true)); Reader r = new CppReader(pp); String text = CharStreams.toString(r).trim(); LOG.info("Output is:\n" + text); assertEquals("one_two_good\n" + "one_two_bad\n" + "\n" + "one_good\n" + "one_bad", text); } }
int idx; Preprocessor pp = new Preprocessor(); pp.addFeature(Feature.DIGRAPHS); pp.addFeature(Feature.TRIGRAPHS);
int idx; Preprocessor pp = new Preprocessor(); pp.addFeature(Feature.DIGRAPHS); pp.addFeature(Feature.TRIGRAPHS);
+ "PASTE_VAARGS(a) // PASTE_VAARGS 1\n"; LOG.info("Input is:\n" + input); Preprocessor pp = new Preprocessor(); pp.addFeature(Feature.KEEPCOMMENTS); pp.addInput(new StringLexerSource(input, true));
Preprocessor pp = new Preprocessor(); pp.addFeature(Feature.DIGRAPHS); pp.addFeature(Feature.TRIGRAPHS);
p = new Preprocessor(); p.addFeature(Feature.CSYNTAX); p.addInput(sl); p = new Preprocessor(); p.addFeature(Feature.CSYNTAX); p.addInput(sl); p = new Preprocessor(); p.addInput(sl); assertTrue(testError(p));
p = new Preprocessor(); p.addFeature(Feature.CSYNTAX); p.addInput(sl); p = new Preprocessor(); p.addFeature(Feature.CSYNTAX); p.addInput(sl); p = new Preprocessor(); p.addInput(sl); assertTrue(testError(p));