Package net.sourceforge.veditor.parser.vhdl

Examples of net.sourceforge.veditor.parser.vhdl.Token


    // (cases can be nested)
    int incase = 0;
    int use;
    int EOS;
    for(int i=0;i < tokens.size();i++){
      Token token=tokens.get(i);
      if(token.image.equals("(")) {
        int openParan1=i;
        int closeParan1=skipToCloseParan(tokens, openParan1+1);

        // skip if there are no parameters
View Full Code Here


    // get a list of lines
    String[] lines = text.split("\n");
    ArrayList<Token> tokens=TokenizeText(text);
    HashMap<Integer,ArrayList<Integer>> spaceLocations=new HashMap<Integer,ArrayList<Integer>>();   
    for(int i=0;i<tokens.size();i++){
      Token token=tokens.get(i);
      switch (token.kind) {     
      case VhdlParserCoreTokenManager.CONCAT:
      case VhdlParserCoreTokenManager.EQ:
      case VhdlParserCoreTokenManager.NEQ:
      case VhdlParserCoreTokenManager.GE:
View Full Code Here

  private ArrayList<Token> TokenizeText(String text){
    StringReader stringReader=new StringReader(text);
    CharStream stream=new CharStream(stringReader);
    stream.setTabSize(1); //set the tab size to 1 in order to match string index
    VhdlParserCoreTokenManager tokenManager=new VhdlParserCoreTokenManager(stream);
    Token token=null;
    ArrayList <Token> results=new ArrayList<Token>();
   
    do{
      token=tokenManager.getNextToken();
      if(token.kind != VhdlParserCoreTokenManager.EOF){
View Full Code Here

   
    //find the indent position following the direction directive
    int maxPosAfterDirection=0;
    int lastLineWithToken=0;   
    for(int i=0;i < tokens.size();i++){
      Token token=tokens.get(i);
      if(isTokenOnList(token.kind,valid_tokens) ){   
        lastLineWithToken =  token.beginLine;
        //record the info about the tokens
        StartStop indentInfo = new StartStop();
        indentInfo.start = token.beginColumn;       
View Full Code Here

   
    //find the indent position following the direction directive
    int maxPosAfterDirection=0;
    int lastLineWithToken=0;   
    for(int i=0;i < tokens.size();i++){
      Token token=tokens.get(i);         
      
      if(isTokenOnList(token.kind,valid_tokens) ){       
        lastLineWithToken =  token.beginLine;
        //make sure there is another token on the same line
        if( (i+1) < tokens.size() && token.beginLine == tokens.get(i+1).beginLine){
View Full Code Here

    if(lines.length < 2){
      return text;
    }
   
    for (int tokennr = 0; tokennr < tokens.size(); tokennr++) {
      Token token = tokens.get(tokennr);
      for (int s = 0; s < HdlScanner.vhdlWords.length; s++) {

        if (token.image.equalsIgnoreCase(HdlScanner.vhdlWords[s])) {

          token.image = token.image.toLowerCase();
View Full Code Here

  public String getIdentifier(){
    //ASTname astName=(ASTname)getChild(0);
    //return ((ASTidentifier)(astName.getChild(0))).name;
   
    String completetype = "";
    Token curtoken = getFirstToken();
    if(curtoken!=null) {
      curtoken = curtoken.next;
      if(curtoken != null) completetype = curtoken.toString();
    }
    return completetype;
   
   
    /*
 
View Full Code Here

TOP

Related Classes of net.sourceforge.veditor.parser.vhdl.Token

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.