Examples of Mark


Examples of com.google.caja.lexer.TokenQueue.Mark

    return r;
  }

  private Identifier parseIdentifierNode(boolean allowReservedWords)
      throws ParseException {
    Mark m = tq.mark();
    String identifierName = parseIdentifier(allowReservedWords);
    Identifier ident = new Identifier(posFrom(m), identifierName);
    finish(ident, m);
    return ident;
  }
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

    return ident;
  }

  private ExpressionStmt parseExpressionStmt(boolean insertionProtected)
      throws ParseException {
    Mark m = tq.mark();
    Expression e = parseExpressionInt(insertionProtected);
    ExpressionStmt es = new ExpressionStmt(posFrom(m), e);
    finish(es, m);
    return es;
  }
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

  }

  private Expression parseExpressionOrNoop(
      AbstractExpression def, boolean insertionProtected)
      throws ParseException {
    Mark m = tq.mark();
    if (tq.checkToken(Punctuation.SEMI)) {
      finish(def, m);
      return def;
    }
    Expression e = parseExpressionInt(insertionProtected);
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

  }

  private AbstractStatement parseDeclarationsOrExpression(
      boolean insertionProtected)
      throws ParseException {
    Mark m = tq.mark();

    boolean isDeclaration;

    if (tq.checkToken(Keyword.VAR)) {
      isDeclaration = true;
    } else if (tq.checkToken(Keyword.CONST)) {
      isDeclaration = true;
      mq.addMessage(MessageType.NOT_IE, posFrom(m));
    } else {
      isDeclaration = false;
    }

    if (isDeclaration) {
      AbstractStatement s;
      Declaration d;
      {
        Identifier idNode = parseIdentifierNode(false);
        Expression initializer = null;
        if (tq.checkToken(Punctuation.EQ)) {
          initializer = parseExpressionPart(insertionProtected);
        }
        d = new Declaration(posFrom(m), idNode, initializer);
        finish(d, m);
      }
      if (tq.checkToken(Punctuation.COMMA)) {
        List<Declaration> decls = Lists.newArrayList();
        decls.add(d);
        do {
          Mark m2 = tq.mark();
          Identifier idNode = parseIdentifierNode(false);
          Expression initializer = null;
          if (tq.checkToken(Punctuation.EQ)) {
            initializer = parseExpressionPart(insertionProtected);
          }
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

  private FormalParamList parseFormalParams() throws ParseException {
    List<FormalParam> params = Lists.newArrayList();
    if (!tq.lookaheadToken(Punctuation.RPAREN)) {
      do {
        Mark m = tq.mark();
        FormalParam param = new FormalParam(parseIdentifierNode(false));
        finish(param, m);
        params.add(param);
      } while (tq.checkToken(Punctuation.COMMA));
    }
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

   * Attaches to the parse tree filtered tokens,
   * such as type annotation carrying comments.
   */
  private void finish(AbstractParseTreeNode n, Mark startMark)
      throws ParseException {
    Mark endMark = tq.mark();
    tq.rewind(startMark);
    try {
      n.setComments(tq.filteredTokens());
    } finally {
      tq.rewind(endMark);
View Full Code Here

Examples of com.google.caja.lexer.TokenQueue.Mark

  private Function<DOMImplementation, DocumentType> findDoctype()
      throws ParseException {
    if (tokens.isEmpty()) { return null; }
    Function<DOMImplementation, DocumentType> doctypeMaker = null;
    Mark start = tokens.mark();

    doctypeloop:
    while (!tokens.isEmpty()) {
      Token<HtmlTokenType> t = tokens.peek();
      switch (t.type) {
View Full Code Here

Examples of com.kiouri.sliderbar.client.view.Mark

      markWidth  = 1;
      markHeight = delimSize;     
    }
   
    for (int i = 0; i<= this.maxValue; i++){
       Mark mark = new Mark(color, markWidth, markHeight);
       int markPosition = sliderBarCalulator.clcAbsPositionByValue(i);
       display.putMark(mark, markPosition);
    }
  }
View Full Code Here

Examples of lab5.common.Mark

        {
            @Override
            public void mousePressed(MouseEvent e) {
                model.setX((e.getX()-model.getOrigin().getX())/model.getStep());
                model.setY((e.getY()-model.getOrigin().getY())/model.getStep());
                model.addPoint(new Mark(model.getX(), model.getY()));
                update();
            }
           
        };     
        plot.addMouseListener(mouseAdapter);
        plot.addMouseMotionListener(mouseAdapter);


        lblR = new JLabel();
        lblR.setText("R: ");
        lblR.setForeground(Color.WHITE);
        lblR.setBorder(BorderFactory.createEmptyBorder(0, 10 , 0 ,10));
       
        sliderR = new JSlider(1,10);    
        sliderR.setValue(1);
        ChangeListener sliderRListener = new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                model.setR((Integer)sliderR.getValue());
                update();
            }
        };       
        sliderR.addChangeListener(sliderRListener);
        sliderR.setMaximumSize(new Dimension(350,25));
               
        header.add(lblR);
        header.add(sliderR);

        lblX = new JLabel();
        lblX.setText("X: ");
        lblX.setForeground(Color.WHITE);
        lblX.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
           
        String choices[] = {"0","1","2","-1","-2","-3"};
        comboX = new JComboBox<String>();
        for (int i = 0; i < choices.length; i++)
            comboX.addItem (choices[i]);

        comboX.addItemListener(new ItemListener(){
            @Override
            public void itemStateChanged(ItemEvent e)
            {
                String item = (String)comboX.getSelectedItem();
                model.setX(Integer.valueOf(item));
                model.setSelectedX(model.getX());
                model.setY(model.getSelectedY());
                model.addPoint(new Mark(model.getX(),model.getY()));
                update();
       
            }
        });
        comboX.setMaximumSize(new Dimension(150, 25));
       
        header.add(lblX);
        header.add(comboX);

        lblY = new JLabel();
        lblY.setText("Y: ");
        lblY.setForeground(Color.WHITE);
        lblY.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
       
        header.add(lblY);
       
        groupY = new ButtonGroup();
        ActionListener radioButtonActionListner = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                String command = evt.getActionCommand();
                model.setY(Integer.valueOf(command));
                model.setSelectedY(model.getY());
                model.setX(model.getSelectedX());
                model.addPoint(new Mark(model.getX(),model.getY()));
                update();
            }
        };
        String radioButtonContraints[] = {"-2","-1","0","1","2"};
        JRadioButton radioButton = new JRadioButton(radioButtonContraints[0]);
View Full Code Here

Examples of org.allspice.bytecode.Mark

public class TestIFGT0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfGreaterThan0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.