1 28 29 package org.objectweb.util.cpp.lib; 30 31 import org.objectweb.util.cpp.api.Preprocessor; 32 33 41 public class OptionDNAME 42 extends PreprocessorOptionBase 43 { 44 50 56 61 public 62 OptionDNAME(Preprocessor preprocessor) 63 { 64 setLabels(new String [] { "-DNAME", "-DNAME=DEF" }); 65 setDescription(new String [] { "Define NAME as DEF, default is 1"}); 66 setPreprocessor(preprocessor); 67 } 68 69 75 81 87 93 98 public String getBaseOptionLabel() { 99 return "-D"; 100 } 101 102 107 public void consumeOption(String current) { 108 int index = current.indexOf("="); 110 if (index != -1) { 111 getPreprocessor().addMacro(current.substring(0,index), 112 current.substring(index+1)); 113 } else { 114 getPreprocessor().addMacro(current); 115 } 116 } 117 118 } 124 | Popular Tags |