Java Code Examples for com.intellij.lang.PsiBuilder.Marker

The following examples show how to use com.intellij.lang.PsiBuilder.Marker. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 6 votes vote down vote up
static boolean declarations(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "declarations")) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b);
    r = declaration(b, l + 1);
    while (r) {
        int c = current_position_(b);
        if (!declaration(b, l + 1)) {
            break;
        }
        if (!empty_element_parsed_guard_(b, "declarations", c)) {
            break;
        }
    }
    exit_section_(b, m, null, r);
    return r;
}
 
Example 2
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 6 votes vote down vote up
public static boolean Macro(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Macro")) return false;
  if (!nextTokenIs(b, MACRO_TAG)) return false;
  boolean r, p;
  Marker m = enter_section_(b, l, _NONE_, MACRO, null);
  r = consumeToken(b, MACRO_TAG);
  p = r; // pin = 1
  r = r && report_error_(b, Identifier(b, l + 1));
  r = p && report_error_(b, MacroParams(b, l + 1)) && r;
  r = p && report_error_(b, Macro_3(b, l + 1)) && r;
  r = p && report_error_(b, Macro_4(b, l + 1)) && r;
  r = p && report_error_(b, Macro_5(b, l + 1)) && r;
  r = p && consumeToken(b, MACRO_END_TAG) && r;
  exit_section_(b, l, m, r, p, null);
  return r || p;
}
 
Example 3
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 6 votes vote down vote up
public static boolean rule_pattern(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "rule_pattern")) {
        return false;
    }
    if (!nextTokenIs(b, "<rule pattern>", IDENT, LBRACE)) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, RULE_PATTERN, "<rule pattern>");
    r = rule_pattern_0(b, l + 1);
    r = r && consumeToken(b, LBRACE);
    r = r && semantic_action(b, l + 1);
    r = r && consumeToken(b, RBRACE);
    exit_section_(b, l, m, r, false, null);
    return r;
}
 
Example 4
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 6 votes vote down vote up
public static boolean Mnemonic(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Mnemonic")) return false;
  boolean r;
  Marker m = enter_section_(b, l, _NONE_, MNEMONIC, "<mnemonic>");
  r = consumeTokenSmart(b, GENERAL_OP);
  if (!r) r = consumeTokenSmart(b, SYSTEM_OP);
  if (!r) r = consumeTokenSmart(b, VIRTUALIZATION_OP);
  if (!r) r = consumeTokenSmart(b, X64_OP);
  if (!r) r = consumeTokenSmart(b, FPU_OP);
  if (!r) r = consumeTokenSmart(b, MMX_OP);
  if (!r) r = consumeTokenSmart(b, SSE_OP);
  if (!r) r = consumeTokenSmart(b, SSE2_OP);
  if (!r) r = consumeTokenSmart(b, SSE3_OP);
  if (!r) r = consumeTokenSmart(b, SSE4_OP);
  if (!r) r = consumeTokenSmart(b, AVX_OP);
  if (!r) r = consumeTokenSmart(b, AVX2_OP);
  if (!r) r = consumeTokenSmart(b, AVX512_OP);
  exit_section_(b, l, m, r, false, null);
  return r;
}
 
Example 5
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 6 votes vote down vote up
public static boolean Preprocessor(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Preprocessor")) return false;
  boolean r;
  Marker m = enter_section_(b, l, _NONE_, PREPROCESSOR, "<preprocessor>");
  r = Include(b, l + 1);
  if (!r) r = Define(b, l + 1);
  if (!r) r = Assign(b, l + 1);
  if (!r) r = Macro(b, l + 1);
  if (!r) r = MacroDefCall(b, l + 1);
  if (!r) r = MacroCall(b, l + 1);
  if (!r) r = Strlen(b, l + 1);
  if (!r) r = Error(b, l + 1);
  if (!r) r = Conditional(b, l + 1);
  if (!r) r = PreprocessorExpr(b, l + 1);
  exit_section_(b, l, m, r, false, null);
  return r;
}
 
Example 6
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 6 votes vote down vote up
public static boolean declaration(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "declaration")) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, DECLARATION, "<declaration>");
    r = token_dcl(b, l + 1);
    if (!r) {
        r = start_dcl(b, l + 1);
    }
    if (!r) {
        r = type_dcl(b, l + 1);
    }
    if (!r) {
        r = left_dcl(b, l + 1);
    }
    if (!r) {
        r = right_dcl(b, l + 1);
    }
    exit_section_(b, l, m, r, false, null);
    return r;
}
 
Example 7
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 6 votes vote down vote up
static boolean rules(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "rules")) {
        return false;
    }
    if (!nextTokenIs(b, IDENT)) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b);
    r = rule(b, l + 1);
    while (r) {
        int c = current_position_(b);
        if (!rule(b, l + 1)) {
            break;
        }
        if (!empty_element_parsed_guard_(b, "rules", c)) {
            break;
        }
    }
    exit_section_(b, m, null, r);
    return r;
}
 
Example 8
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
public void parseLight(IElementType t, PsiBuilder b) {
  boolean r;
  b = adapt_builder_(t, b, this, EXTENDS_SETS_);
  Marker m = enter_section_(b, 0, _COLLAPSE_, null);
  r = parse_root_(t, b);
  exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
}
 
Example 9
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
static boolean AddressInternal(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "AddressInternal")) return false;
  if (!nextTokenIs(b, SQUARE_L)) return false;
  boolean r, p;
  Marker m = enter_section_(b, l, _NONE_);
  r = consumeToken(b, SQUARE_L);
  p = r; // pin = 1
  r = r && report_error_(b, AddressInternal_1(b, l + 1));
  r = p && report_error_(b, Expr(b, l + 1, -1)) && r;
  r = p && consumeToken(b, SQUARE_R) && r;
  exit_section_(b, l, m, r, p, null);
  return r || p;
}
 
Example 10
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
public static boolean MacroVarReference(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "MacroVarReference")) return false;
  if (!nextTokenIsSmart(b, MACRO_VAR_REF, SIZE_TYPE)) return false;
  boolean r;
  Marker m = enter_section_(b, l, _NONE_, MACRO_VAR_REFERENCE, "<macro var reference>");
  r = MacroVarReference_0(b, l + 1);
  r = r && consumeToken(b, MACRO_VAR_REF);
  exit_section_(b, l, m, r, false, null);
  return r;
}
 
Example 11
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
static boolean Condition(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Condition")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = Expr(b, l + 1, -1);
  r = r && Condition_1(b, l + 1);
  r = r && Expr(b, l + 1, -1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 12
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean SegmentAddress_1_2_1(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "SegmentAddress_1_2_1")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = SegmentAddress_1_2_1_0(b, l + 1);
  r = r && SegmentAddress_1_2_1_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 13
Source Project: idea-php-dotenv-plugin   Source File: DotEnvParser.java    License: MIT License 5 votes vote down vote up
private static boolean property_1(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "property_1")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = key(b, l + 1);
  r = r && property_1_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 14
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
public static boolean Reg(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Reg")) return false;
  if (!nextTokenIsSmart(b, REGISTER, SIZE_TYPE)) return false;
  boolean r;
  Marker m = enter_section_(b, l, _NONE_, REG, "<reg>");
  r = Reg_0(b, l + 1);
  r = r && consumeToken(b, REGISTER);
  exit_section_(b, l, m, r, false, null);
  return r;
}
 
Example 15
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Conditional_0_4_0_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Conditional_0_4_0_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = Conditional_0_4_0_0_0(b, l + 1);
  if (!r) r = consumeToken(b, ELSE_TAG);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 16
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Conditional_0_4_0_0_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Conditional_0_4_0_0_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = consumeToken(b, ELIF_TAG);
  r = r && Conditional_0_4_0_0_0_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 17
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 5 votes vote down vote up
public static boolean rule_body(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "rule_body")) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, RULE_BODY, "<rule body>");
    r = rule_body_0(b, l + 1);
    r = r && rule_pattern(b, l + 1);
    r = r && rule_body_2(b, l + 1);
    r = r && consumeToken(b, SEMI);
    exit_section_(b, l, m, r, false, null);
    return r;
}
 
Example 18
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean SegmentAddress_1_1_1(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "SegmentAddress_1_1_1")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = SegmentAddress_1_1_1_0(b, l + 1);
  r = r && SegmentAddress_1_1_1_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 19
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 5 votes vote down vote up
public static boolean header(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "header")) {
        return false;
    }
    if (!nextTokenIs(b, HEADER_START)) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b);
    r = consumeTokens(b, 0, HEADER_START, OCAML_LAZY_NODE, HEADER_STOP);
    exit_section_(b, m, HEADER, r);
    return r;
}
 
Example 20
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
static boolean DataValue(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "DataValue")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = DataValue_0(b, l + 1);
  r = r && DataValue_1(b, l + 1);
  r = r && DataValue_2(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 21
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean SegmentAddress_1_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "SegmentAddress_1_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = consumeTokenSmart(b, SEGMENT_ADDR_L);
  r = r && SegmentAddress_1_0_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 22
Source Project: idea-php-dotenv-plugin   Source File: DotEnvParser.java    License: MIT License 5 votes vote down vote up
private static boolean property_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "property_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = key(b, l + 1);
  r = r && consumeToken(b, SEPARATOR);
  r = r && property_0_2(b, l + 1);
  r = r && property_0_3(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 23
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
public static boolean Define(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Define")) return false;
  if (!nextTokenIs(b, DEFINE_TAG)) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = Define_0(b, l + 1);
  r = r && Define_1(b, l + 1);
  r = r && Define_2(b, l + 1);
  exit_section_(b, m, DEFINE, r);
  return r;
}
 
Example 24
Source Project: idea-php-dotenv-plugin   Source File: DotEnvParser.java    License: MIT License 5 votes vote down vote up
static boolean item_(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "item_")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = item__0(b, l + 1);
  if (!r) r = consumeToken(b, COMMENT);
  if (!r) r = consumeToken(b, CRLF);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 25
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
public static boolean MacroParamCounter(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "MacroParamCounter")) return false;
  if (!nextTokenIsSmart(b, MACRO_PARAM_COUNT, SIZE_TYPE)) return false;
  boolean r;
  Marker m = enter_section_(b, l, _NONE_, MACRO_PARAM_COUNTER, "<macro param counter>");
  r = MacroParamCounter_0(b, l + 1);
  r = r && consumeToken(b, MACRO_PARAM_COUNT);
  exit_section_(b, l, m, r, false, null);
  return r;
}
 
Example 26
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Define_0_0_3_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Define_0_0_3_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = Expr(b, l + 1, -1);
  r = r && Define_0_0_3_0_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 27
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Define_0_0_3_0_1_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Define_0_0_3_0_1_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = consumeToken(b, SEPARATOR);
  r = r && Expr(b, l + 1, -1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 28
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Define_0_1(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Define_0_1")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = consumeToken(b, DEFINE_TAG);
  r = r && Identifier(b, l + 1);
  r = r && Define_0_1_2(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 29
Source Project: JetBrains-NASM-Language   Source File: NASMParser.java    License: MIT License 5 votes vote down vote up
private static boolean Define_0_1_2_0(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "Define_0_1_2_0")) return false;
  boolean r;
  Marker m = enter_section_(b);
  r = Expr(b, l + 1, -1);
  if (!r) r = Define_0_1_2_0_1(b, l + 1);
  exit_section_(b, m, null, r);
  return r;
}
 
Example 30
Source Project: reasonml-idea-plugin   Source File: OclYaccParser.java    License: MIT License 5 votes vote down vote up
static boolean yacc(@NotNull PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "yacc")) {
        return false;
    }
    boolean r;
    Marker m = enter_section_(b);
    r = yacc_0(b, l + 1);
    r = r && yacc_1(b, l + 1);
    r = r && declarations(b, l + 1);
    r = r && consumeToken(b, SECTION_SEPARATOR);
    r = r && rules(b, l + 1);
    r = r && yacc_5(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
}