Package Coco

Examples of Coco.TokenMapGenerator


 
 
  private void createConfigFiles(Parser parser, String folderPath, String configPath, String editorSuffix, String packageName) throws IOException{
    ArrayList terminals = parser.tab.terminals;
    ArrayList productions = parser.tab.nonterminals;
    TokenMapGenerator provider = new TokenMapGenerator(terminals, productions);
   
   
    File file = new File(configPath);
    file.mkdirs();
   
    File tokenMap = new File(file.getAbsolutePath()+Path.SEPARATOR+editorSuffix+".cnfg");
    if(tokenMap.exists()){
      tokenMap.delete();
    }
    tokenMap.createNewFile();
    FileWriter writer = new FileWriter(tokenMap);

   
    provider.generateTokenMap(writer);
    writer.close();
   
    File preferenceMap = new File(file.getAbsolutePath()+Path.SEPARATOR+editorSuffix+".pref");
    if(!preferenceMap.exists()){
      preferenceMap.createNewFile();
      writer = new FileWriter(preferenceMap);
     
      provider.generatePreferenceMap(writer);
      writer.close();
    }
   
    String providerPrefix = (new String()+editorSuffix.charAt(0)).toUpperCase()+editorSuffix.substring(1);
    String proposalProviderFilePath = configPath+Path.SEPARATOR+providerPrefix+"_ProposalProvider.java";
View Full Code Here

TOP

Related Classes of Coco.TokenMapGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.