1 19 20 package org.netbeans.modules.lexer.gen.handcoded; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import org.netbeans.modules.lexer.gen.DescriptionReader; 25 import org.netbeans.modules.lexer.gen.LanguageGenerator; 26 import org.netbeans.modules.lexer.gen.LanguageData; 27 import org.netbeans.modules.lexer.gen.util.LexerGenUtilities; 28 import org.xml.sax.SAXException ; 29 30 36 37 public class HandcodedLanguageGenerator extends LanguageGenerator { 38 39 public String generate(String langClassName, String lexerClassName, 40 String tokenTypesClassName, File xmlLangDescFile) 41 throws SAXException , IOException { 42 43 LanguageData data = new LanguageData(); 44 data.setLanguageClassName(langClassName); 45 data.setLexerClassName(lexerClassName); 46 47 if (xmlLangDescFile != null) { 49 DescriptionReader xmlLangDesc = new DescriptionReader( 50 xmlLangDescFile.getAbsolutePath()); 51 52 xmlLangDesc.applyTo(data); 53 } 54 55 data.updateUnassignedIntIds(); 57 58 return createSource(data); 59 } 60 61 } 62 63 | Popular Tags |