Package xscript.compiler

Examples of xscript.compiler.XLineDesk


      return false;
    }
  }
 
  public void startLineBlock(){
    lines.add(new XLineDesk(token.lineDesk.startLine, token.lineDesk.startLinePos, -1, -1));
  }
View Full Code Here


  public void startLineBlock(){
    lines.add(new XLineDesk(token.lineDesk.startLine, token.lineDesk.startLinePos, -1, -1));
  }
 
  public XLineDesk endLineBlock(){
    XLineDesk line = lines.remove(lines.size()-1);
    if(line.endLine==-1 && line.endLinePos==-1)
      return null;
    return line;
  }
View Full Code Here

    XIdent name;
    List<XType> typeParam = null;
    if(token.kind==XTokenKind.BOOL || token.kind==XTokenKind.BYTE || token.kind==XTokenKind.SHORT ||
        token.kind==XTokenKind.CHAR || token.kind==XTokenKind.INT || token.kind==XTokenKind.FLOAT ||
        token.kind==XTokenKind.DOUBLE || token.kind==XTokenKind.VOID){
      name = new XIdent(new XLineDesk(token.lineDesk), token.kind.name);
      nextToken();
    }else{
      name = qualident();
      if(token.kind==XTokenKind.SMALLER){
        nextToken();
View Full Code Here

    return list;
  }
 
  public XVarDecls makeVarDeclStatement(XModifier modifier){
    XType type = makeType();
    XLineDesk line = new XLineDesk(token.lineDesk);
    String name = ident();
    XVarDecls varDecl = makeVarDecls(line, modifier, type, name);
    expected(XTokenKind.SEMICOLON);
    return varDecl;
  }
View Full Code Here

      XType type = makeType();
      boolean knowRealy = type.array!=0;
      XVarDecls decl = null;
      if(token.kind==XTokenKind.IDENT || knowRealy){
        knowRealy |= type.typeParam==null || type.typeParam.size()!=1;
        XLineDesk line = new XLineDesk(token.lineDesk);
        String name = ident();
        if(token.kind==XTokenKind.LINDEX){
          nextToken();
          expected(XTokenKind.RINDEX);
          decl = makeVarDecls(line, new XModifier(line, 0), type, name, 1);
View Full Code Here

    List<XVarDecl> list = new ArrayList<XVarDecl>();
    startLineBlock();
    list.add(makeVarDecl(line, modifier, type, name, arrayAdd));
    while(token.kind==XTokenKind.COMMA){
      nextToken();
      XLineDesk lline = new XLineDesk(token.lineDesk);
      name = ident();
      list.add(makeVarDecl(lline, modifier, type, name, 0));
    }
    line.endLine = token.lineDesk.endLine;
    line.endLinePos = token.lineDesk.endLinePos;
View Full Code Here

      return classDecl(modifier);
    }
    List<XTypeParam> typeParam = makeTypeParamList();
    XType type = makeType();
    boolean isConstructor = token.kind==XTokenKind.LGROUP && type.name.name.equals(className);
    XLineDesk line = new XLineDesk(token.lineDesk);
    String name = isConstructor?"<init>":ident();
    if(isConstructor || token.kind==XTokenKind.LGROUP){
      return makeMethodDecl(line, modifier, typeParam, type, name, isInterface);
    }else{
      XTree tree = makeVarDecls(line, modifier, type, name);
View Full Code Here

      if(token.kind==XTokenKind.IMPLEMENTS){
        nextToken();
        superClasses.addAll(makeTypeList(XTokenKind.COMMA));
      }
    }
    XLineDesk line = endLineBlock();
    List<XTree> body = classAndInterfaceBody(false, name);
    return new XClassDecl(line, modifier, name, typeParam, superClasses, body);
  }
View Full Code Here

    }else if(token.kind==XTokenKind.EXTENDS){
      nextToken();
      parserMessage(XMessageLevel.INFO, "newextends");
      superClasses = makeTypeList(XTokenKind.COMMA);
    }
    XLineDesk line = endLineBlock();
    List<XTree> body = classAndInterfaceBody(true, name);
    return new XClassDecl(line, modifier, name, typeParam, superClasses, body);
  }
View Full Code Here

    }else if(token.kind==XTokenKind.IMPLEMENTS){
      nextToken();
      parserMessage(XMessageLevel.INFO, "newextends");
      superClasses.addAll(makeTypeList(XTokenKind.COMMA));
    }
    XLineDesk line = endLineBlock();
    List<XTree> body = enumBody(name);
    return new XClassDecl(line, modifier, name, null, superClasses, body);
  }
View Full Code Here

TOP

Related Classes of xscript.compiler.XLineDesk

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.