Examples of IElementType


Examples of com.intellij.psi.tree.IElementType

  @Override
  public MathematicaParser.Result parse(MathematicaParser parser, MathematicaParser.Result left) throws CriticalParserError {
    if (!left.isValid()) return MathematicaParser.notParsed();
    PsiBuilder.Marker blankMark = left.getMark().precede();
    IElementType token = MathematicaElementTypes.BLANK_EXPRESSION;
    parser.advanceLexer();
    if (!parser.isNextWhitespace() && !parser.eof() && parser.getTokenType().equals(MathematicaElementTypes.IDENTIFIER)) {
      final PrefixParselet symbolParselet = ParseletProvider.getPrefixParselet(MathematicaElementTypes.IDENTIFIER);
      symbolParselet.parse(parser);
    }
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

  @Override
  public MathematicaParser.Result parse(MathematicaParser parser, MathematicaParser.Result left) throws CriticalParserError {
    if (!left.isValid()) return MathematicaParser.notParsed();
    PsiBuilder.Marker infixOperationMarker = left.getMark().precede();
    IElementType token = ParseletProvider.getInfixPsiElement(this);

    parser.advanceLexer();

    MathematicaParser.Result result = parser.parseExpression(myPrecedence - (myRightAssociative ? 1 : 0));
    if (result.isParsed()) {
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

  @Override
  public MathematicaParser.Result parse(MathematicaParser parser, MathematicaParser.Result left) throws CriticalParserError {
    if (!left.isValid()) return MathematicaParser.notParsed();
    PsiBuilder.Marker putMark = left.getMark().precede();
    final IElementType tokenType = parser.getTokenType();
    final IElementType type = tokenType.equals(MathematicaElementTypes.PUT) ? MathematicaElementTypes.PUT_EXPRESSION : MathematicaElementTypes.PUT_APPEND_EXPRESSION;
    parser.advanceLexer();
    if (parser.matchesToken(MathematicaElementTypes.STRINGIFIED_IDENTIFIER)) {
      final MathematicaParser.Result result1 = parser.parseExpression(myPrecedence);
      putMark.done(type);
      return MathematicaParser.result(putMark, type, result1.isParsed());
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

    if (!builder.eof()) {
      // jumped out of the parser prematurely... try and figure out what's tripping it up,
      // then jump back in

      // deal with some unexpected tokens
      IElementType tokenType = builder.getTokenType();
      int problemOffset = builder.getCurrentOffset();

      if (tokenType == OPEN_ENDBLOCK) {
        parseCloseBlock(builder);
      }
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

   * | CONTENT
   * | COMMENT
   * ;
   */
  private boolean parseStatement(PsiBuilder builder) {
    IElementType tokenType = builder.getTokenType();

    if (atOpenInverseExpression(builder)) {
      PsiBuilder.Marker inverseBlockStartMarker = builder.mark();
      PsiBuilder.Marker lookAheadMarker = builder.mark();
      boolean isSimpleInverse = parseSimpleInverse(builder);
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

        SortedMap<ILocation, Filler> ranges = new TreeMap<ILocation, Filler>();
        String text = file.getText();
        HaskellLexer lexer = new HaskellLexer();
        lexer.start(text);
        while (true) {
            IElementType type = lexer.getTokenType();
            if (type == null)
                break;
            if (!HaskellTokenTypes.WHITESPACES.contains(type)) {
                TextRange textRange = new TextRange(lexer.getTokenStart(), lexer.getTokenEnd());
                IRange range = new MyRange(textRange);
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

    @NotNull
    public ASTNode parse(IElementType root, PsiBuilder builder) {
        builder.setDebugMode(true);
        PsiBuilder.Marker start = builder.mark();
        while (true) {
            IElementType type = builder.getTokenType();
            if (type == null)
                break;
            if (!parseInfixPrefixIdent(builder, HaskellTokenTypes.L_PAREN, HaskellTokenTypes.R_PAREN, HaskellTokenTypes.OPERATORS)
                && !parseInfixPrefixIdent(builder, HaskellTokenTypes.BACKQUOTE, HaskellTokenTypes.BACKQUOTE, HaskellTokenTypes.VAR_IDS)
                && HaskellTokenTypes.IDS.contains(type)) {
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

        start.done(root);
        return builder.getTreeBuilt();
    }

    private static boolean parseInfixPrefixIdent(PsiBuilder builder, IElementType leftType, IElementType rightType, TokenSet idsOrOperators) {
        IElementType type = builder.getTokenType();
        if (type == null)
            return false;
        if (type == leftType) {
            PsiBuilder.Marker infixPrefixExpression = builder.mark();
            builder.advanceLexer();
            IElementType idOrOperType = builder.getTokenType();
            if (idsOrOperators.contains(idOrOperType)) {
                PsiBuilder.Marker idOrOper = builder.mark();
                builder.advanceLexer();
                idOrOper.done(idOrOperType);
                IElementType rparType = builder.getTokenType();
                if (rparType == rightType) {
                    builder.advanceLexer();
                    infixPrefixExpression.done(HaskellElementTypes.INFIX_PREFIX_IDENT);
                    return true;
                } else {
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

        return STRINGS;
    }

    @NotNull
    public PsiElement createElement(ASTNode node) {
        IElementType type = node.getElementType();
        if (type == HaskellElementTypes.MODULE) { // where is it initialized???
            return new HPModuleImpl(node);
        } else if (type == HaskellElementTypes.INFIX_PREFIX_IDENT) {
            return new HPInfixPrefixIdentImpl(node);
        } else if (HaskellTokenTypes.IDS.contains(type)) {
View Full Code Here

Examples of com.intellij.psi.tree.IElementType

        SelectionModel selectionModel = editor.getSelectionModel();

        // pastes in block selection mode (column mode) are not handled by a CopyPasteProcessor
        int selectionStart = selectionModel.getSelectionStart();
        int selectionEnd = selectionModel.getSelectionEnd();
        IElementType tokenType = findLiteralTokenType(file, selectionStart, selectionEnd);

        if (tokenType == HaskellTokenTypes.STRING) {
            if (rawText != null && rawText.rawText != null)
                return rawText.rawText; // Copied from the string literal. Copy as is.
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.