aState
+ */
+ private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+ private static final String ZZ_ATTRIBUTE_PACKED_0 =
+ "\1\1\1\11\22\1\10\11\1\1\2\11\3\1\3\11"+
+ "\2\1\2\0\26\1\7\11\1\1\1\11\1\0\51\1";
+
+ private static int [] zzUnpackAttribute() {
+ int [] result = new int[114];
+ int offset = 0;
+ offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+ return result;
+ }
+
+ private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ do result[j++] = value; while (--count > 0);
+ }
+ return j;
+ }
+
+ /** the input device */
+ private java.io.Reader zzReader;
+
+ /** the current state of the DFA */
+ private int zzState;
+
+ /** the current lexical state */
+ private int zzLexicalState = YYINITIAL;
+
+ /** this buffer contains the current text to be matched and is
+ the source of the yytext() string */
+ private CharSequence zzBuffer = "";
+
+ /** the textposition at the last accepting state */
+ private int zzMarkedPos;
+
+ /** the current text position in the buffer */
+ private int zzCurrentPos;
+
+ /** startRead marks the beginning of the yytext() string in the buffer */
+ private int zzStartRead;
+
+ /** endRead marks the last character in the buffer, that has been read
+ from input */
+ private int zzEndRead;
+
+ /**
+ * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+ */
+ private boolean zzAtBOL = true;
+
+ /** zzAtEOF == true <=> the scanner is at the EOF */
+ private boolean zzAtEOF;
+
+ /** denotes if the user-EOF-code has already been executed */
+ private boolean zzEOFDone;
+
+ /* user code: */
+ public _AikenLexer() {
+ this((java.io.Reader)null);
+ }
+
+
+ /**
+ * Creates a new scanner
+ *
+ * @param in the java.io.Reader to read input from.
+ */
+ public _AikenLexer(java.io.Reader in) {
+ this.zzReader = in;
+ }
+
+
+ /**
+ * Unpacks the compressed character translation table.
+ *
+ * @param packed the packed character translation table
+ * @return the unpacked character translation table
+ */
+ private static char [] zzUnpackCMap(String packed) {
+ int size = 0;
+ for (int i = 0, length = packed.length(); i < length; i += 2) {
+ size += packed.charAt(i);
+ }
+ char[] map = new char[size];
+ int i = 0; /* index in packed string */
+ int j = 0; /* index in unpacked array */
+ while (i < packed.length()) {
+ int count = packed.charAt(i++);
+ char value = packed.charAt(i++);
+ do map[j++] = value; while (--count > 0);
+ }
+ return map;
+ }
+
+ public final int getTokenStart() {
+ return zzStartRead;
+ }
+
+ public final int getTokenEnd() {
+ return getTokenStart() + yylength();
+ }
+
+ public void reset(CharSequence buffer, int start, int end, int initialState) {
+ zzBuffer = buffer;
+ zzCurrentPos = zzMarkedPos = zzStartRead = start;
+ zzAtEOF = false;
+ zzAtBOL = true;
+ zzEndRead = end;
+ yybegin(initialState);
+ }
+
+ /**
+ * Refills the input buffer.
+ *
+ * @return false
, iff there was new input.
+ *
+ * @exception java.io.IOException if any I/O-Error occurs
+ */
+ private boolean zzRefill() throws java.io.IOException {
+ return true;
+ }
+
+
+ /**
+ * Returns the current lexical state.
+ */
+ public final int yystate() {
+ return zzLexicalState;
+ }
+
+
+ /**
+ * Enters a new lexical state
+ *
+ * @param newState the new lexical state
+ */
+ public final void yybegin(int newState) {
+ zzLexicalState = newState;
+ }
+
+
+ /**
+ * Returns the text matched by the current regular expression.
+ */
+ public final CharSequence yytext() {
+ return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
+ }
+
+
+ /**
+ * Returns the character at position pos from the
+ * matched text.
+ *
+ * It is equivalent to yytext().charAt(pos), but faster
+ *
+ * @param pos the position of the character to fetch.
+ * A value from 0 to yylength()-1.
+ *
+ * @return the character at position pos
+ */
+ public final char yycharat(int pos) {
+ return zzBuffer.charAt(zzStartRead+pos);
+ }
+
+
+ /**
+ * Returns the length of the matched text region.
+ */
+ public final int yylength() {
+ return zzMarkedPos-zzStartRead;
+ }
+
+
+ /**
+ * Reports an error that occured while scanning.
+ *
+ * In a wellformed scanner (no or only correct usage of
+ * yypushback(int) and a match-all fallback rule) this method
+ * will only be called with things that "Can't Possibly Happen".
+ * If this method is called, something is seriously wrong
+ * (e.g. a JFlex bug producing a faulty scanner etc.).
+ *
+ * Usual syntax/scanner level error handling should be done
+ * in error fallback rules.
+ *
+ * @param errorCode the code of the errormessage to display
+ */
+ private void zzScanError(int errorCode) {
+ String message;
+ try {
+ message = ZZ_ERROR_MSG[errorCode];
+ }
+ catch (ArrayIndexOutOfBoundsException e) {
+ message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+ }
+
+ throw new Error(message);
+ }
+
+
+ /**
+ * Pushes the specified amount of characters back into the input stream.
+ *
+ * They will be read again by then next call of the scanning method
+ *
+ * @param number the number of characters to be read again.
+ * This number must not be greater than yylength()!
+ */
+ public void yypushback(int number) {
+ if ( number > yylength() )
+ zzScanError(ZZ_PUSHBACK_2BIG);
+
+ zzMarkedPos -= number;
+ }
+
+
+ /**
+ * Resumes scanning until the next regular expression is matched,
+ * the end of input is encountered or an I/O-Error occurs.
+ *
+ * @return the next token
+ * @exception java.io.IOException if any I/O-Error occurs
+ */
+ public IElementType advance() throws java.io.IOException {
+ int zzInput;
+ int zzAction;
+
+ // cached fields:
+ int zzCurrentPosL;
+ int zzMarkedPosL;
+ int zzEndReadL = zzEndRead;
+ CharSequence zzBufferL = zzBuffer;
+
+ int [] zzTransL = ZZ_TRANS;
+ int [] zzRowMapL = ZZ_ROWMAP;
+ int [] zzAttrL = ZZ_ATTRIBUTE;
+
+ while (true) {
+ zzMarkedPosL = zzMarkedPos;
+
+ zzAction = -1;
+
+ zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+ zzState = ZZ_LEXSTATE[zzLexicalState];
+
+ // set up zzAction for empty match case:
+ int zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ }
+
+
+ zzForAction: {
+ while (true) {
+
+ if (zzCurrentPosL < zzEndReadL) {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ else if (zzAtEOF) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ // store back cached positions
+ zzCurrentPos = zzCurrentPosL;
+ zzMarkedPos = zzMarkedPosL;
+ boolean eof = zzRefill();
+ // get translated positions and possibly new buffer
+ zzCurrentPosL = zzCurrentPos;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ zzEndReadL = zzEndRead;
+ if (eof) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ }
+ int zzNext = zzTransL[ zzRowMapL[zzState] + ZZ_CMAP(zzInput) ];
+ if (zzNext == -1) break zzForAction;
+ zzState = zzNext;
+
+ zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ zzMarkedPosL = zzCurrentPosL;
+ if ( (zzAttributes & 8) == 8 ) break zzForAction;
+ }
+
+ }
+ }
+
+ // store back cached position
+ zzMarkedPos = zzMarkedPosL;
+
+ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+ zzAtEOF = true;
+ return null;
+ }
+ else {
+ switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+ case 1:
+ { return NUMBER;
+ }
+ // fall through
+ case 54: break;
+ case 2:
+ { return BAD_CHARACTER;
+ }
+ // fall through
+ case 55: break;
+ case 3:
+ { return WHITE_SPACE;
+ }
+ // fall through
+ case 56: break;
+ case 4:
+ { return IDENTIFIER;
+ }
+ // fall through
+ case 57: break;
+ case 5:
+ { return UPPER_IDENTIFIER;
+ }
+ // fall through
+ case 58: break;
+ case 6:
+ { return DIV;
+ }
+ // fall through
+ case 59: break;
+ case 7:
+ { return QUOTE;
+ }
+ // fall through
+ case 60: break;
+ case 8:
+ { return LBRACE;
+ }
+ // fall through
+ case 61: break;
+ case 9:
+ { return RBRACE;
+ }
+ // fall through
+ case 62: break;
+ case 10:
+ { return LBRACK;
+ }
+ // fall through
+ case 63: break;
+ case 11:
+ { return RBRACK;
+ }
+ // fall through
+ case 64: break;
+ case 12:
+ { return LPAREN;
+ }
+ // fall through
+ case 65: break;
+ case 13:
+ { return RPAREN;
+ }
+ // fall through
+ case 66: break;
+ case 14:
+ { return COLON;
+ }
+ // fall through
+ case 67: break;
+ case 15:
+ { return COMMA;
+ }
+ // fall through
+ case 68: break;
+ case 16:
+ { return EQ;
+ }
+ // fall through
+ case 69: break;
+ case 17:
+ { return BANG;
+ }
+ // fall through
+ case 70: break;
+ case 18:
+ { return PLUS;
+ }
+ // fall through
+ case 71: break;
+ case 19:
+ { return MINUS;
+ }
+ // fall through
+ case 72: break;
+ case 20:
+ { return LT;
+ }
+ // fall through
+ case 73: break;
+ case 21:
+ { return GT;
+ }
+ // fall through
+ case 74: break;
+ case 22:
+ { return MUL;
+ }
+ // fall through
+ case 75: break;
+ case 23:
+ { return DOT;
+ }
+ // fall through
+ case 76: break;
+ case 24:
+ { return DIVDIV;
+ }
+ // fall through
+ case 77: break;
+ case 25:
+ { return IF;
+ }
+ // fall through
+ case 78: break;
+ case 26:
+ { return IS;
+ }
+ // fall through
+ case 79: break;
+ case 27:
+ { return FN;
+ }
+ // fall through
+ case 80: break;
+ case 28:
+ { return OR;
+ }
+ // fall through
+ case 81: break;
+ case 29:
+ { return AS;
+ }
+ // fall through
+ case 82: break;
+ case 30:
+ { return EQEQ;
+ }
+ // fall through
+ case 83: break;
+ case 31:
+ { return FAT_ARROW;
+ }
+ // fall through
+ case 84: break;
+ case 32:
+ { return ARROW;
+ }
+ // fall through
+ case 85: break;
+ case 33:
+ { return PIPE;
+ }
+ // fall through
+ case 86: break;
+ case 34:
+ { return AND;
+ }
+ // fall through
+ case 87: break;
+ case 35:
+ { return DOTDOT;
+ }
+ // fall through
+ case 88: break;
+ case 36:
+ { return COMMENT;
+ }
+ // fall through
+ case 89: break;
+ case 37:
+ { return STRING_CONTENT;
+ }
+ // fall through
+ case 90: break;
+ case 38:
+ { return LET;
+ }
+ // fall through
+ case 91: break;
+ case 39:
+ { return PUB;
+ }
+ // fall through
+ case 92: break;
+ case 40:
+ { return USE;
+ }
+ // fall through
+ case 93: break;
+ case 41:
+ { return VIA;
+ }
+ // fall through
+ case 94: break;
+ case 42:
+ { return FAIL;
+ }
+ // fall through
+ case 95: break;
+ case 43:
+ { return ELSE;
+ }
+ // fall through
+ case 96: break;
+ case 44:
+ { return WHEN;
+ }
+ // fall through
+ case 97: break;
+ case 45:
+ { return TEST;
+ }
+ // fall through
+ case 98: break;
+ case 46:
+ { return TYPE;
+ }
+ // fall through
+ case 99: break;
+ case 47:
+ { return TODO;
+ }
+ // fall through
+ case 100: break;
+ case 48:
+ { return TRACE;
+ }
+ // fall through
+ case 101: break;
+ case 49:
+ { return CHECK;
+ }
+ // fall through
+ case 102: break;
+ case 50:
+ { return CONST;
+ }
+ // fall through
+ case 103: break;
+ case 51:
+ { return EXPECT;
+ }
+ // fall through
+ case 104: break;
+ case 52:
+ { return OPAQUE;
+ }
+ // fall through
+ case 105: break;
+ case 53:
+ { return VALIDATOR;
+ }
+ // fall through
+ case 106: break;
+ default:
+ zzScanError(ZZ_NO_MATCH);
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/src/main/gen/com/bloxbean/intelliada/idea/aiken/lang/parser/AikenParser.java b/src/main/gen/com/bloxbean/intelliada/idea/aiken/lang/parser/AikenParser.java
new file mode 100644
index 0000000..50e6ac0
--- /dev/null
+++ b/src/main/gen/com/bloxbean/intelliada/idea/aiken/lang/parser/AikenParser.java
@@ -0,0 +1,800 @@
+// This is a generated file. Not intended for manual editing.
+package com.bloxbean.intelliada.idea.aiken.lang.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiBuilder.Marker;
+import static com.bloxbean.intelliada.idea.aiken.lang.psi.AikenTypes.*;
+import static com.bloxbean.intelliada.idea.aiken.lang.psi.impl.AikenParserUtil.*;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.lang.PsiParser;
+import com.intellij.lang.LightPsiParser;
+
+@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
+public class AikenParser implements PsiParser, LightPsiParser {
+
+ public ASTNode parse(IElementType t, PsiBuilder b) {
+ parseLight(t, b);
+ return b.getTreeBuilt();
+ }
+
+ public void parseLight(IElementType t, PsiBuilder b) {
+ boolean r;
+ b = adapt_builder_(t, b, this, null);
+ Marker m = enter_section_(b, 0, _COLLAPSE_, null);
+ r = parse_root_(t, b);
+ exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
+ }
+
+ protected boolean parse_root_(IElementType t, PsiBuilder b) {
+ return parse_root_(t, b, 0);
+ }
+
+ static boolean parse_root_(IElementType t, PsiBuilder b, int l) {
+ return aikenFile(b, l + 1);
+ }
+
+ /* ********************************************************** */
+ // topLevelDefinition*
+ static boolean aikenFile(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "aikenFile")) return false;
+ while (true) {
+ int c = current_position_(b);
+ if (!topLevelDefinition(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "aikenFile", c)) break;
+ }
+ return true;
+ }
+
+ /* ********************************************************** */
+ // CONST IDENTIFIER EQ variableValue
+ public static boolean constantStatement(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "constantStatement")) return false;
+ if (!nextTokenIs(b, CONST)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeTokens(b, 0, CONST, IDENTIFIER, EQ);
+ r = r && variableValue(b, l + 1);
+ exit_section_(b, m, CONSTANT_STATEMENT, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // constructorIdentifier typeIdentifier [COMMA]
+ static boolean constructorElement(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "constructorElement")) return false;
+ if (!nextTokenIs(b, IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = constructorIdentifier(b, l + 1);
+ r = r && typeIdentifier(b, l + 1);
+ r = r && constructorElement_2(b, l + 1);
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
+ // [COMMA]
+ private static boolean constructorElement_2(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "constructorElement_2")) return false;
+ consumeToken(b, COMMA);
+ return true;
+ }
+
+ /* ********************************************************** */
+ // IDENTIFIER COLON
+ public static boolean constructorIdentifier(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "constructorIdentifier")) return false;
+ if (!nextTokenIs(b, IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeTokens(b, 0, IDENTIFIER, COLON);
+ exit_section_(b, m, CONSTRUCTOR_IDENTIFIER, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // UPPER_IDENTIFIER
+ public static boolean constructorName(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "constructorName")) return false;
+ if (!nextTokenIs(b, UPPER_IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, UPPER_IDENTIFIER);
+ exit_section_(b, m, CONSTRUCTOR_NAME, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // [IDENTIFIER DOT] IDENTIFIER LPAREN [functionCallParam*] RPAREN [PIPE functionCall]
+ public static boolean functionCall(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall")) return false;
+ if (!nextTokenIs(b, IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = functionCall_0(b, l + 1);
+ r = r && consumeTokens(b, 0, IDENTIFIER, LPAREN);
+ r = r && functionCall_3(b, l + 1);
+ r = r && consumeToken(b, RPAREN);
+ r = r && functionCall_5(b, l + 1);
+ exit_section_(b, m, FUNCTION_CALL, r);
+ return r;
+ }
+
+ // [IDENTIFIER DOT]
+ private static boolean functionCall_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall_0")) return false;
+ parseTokens(b, 0, IDENTIFIER, DOT);
+ return true;
+ }
+
+ // [functionCallParam*]
+ private static boolean functionCall_3(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall_3")) return false;
+ functionCall_3_0(b, l + 1);
+ return true;
+ }
+
+ // functionCallParam*
+ private static boolean functionCall_3_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall_3_0")) return false;
+ while (true) {
+ int c = current_position_(b);
+ if (!functionCallParam(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "functionCall_3_0", c)) break;
+ }
+ return true;
+ }
+
+ // [PIPE functionCall]
+ private static boolean functionCall_5(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall_5")) return false;
+ functionCall_5_0(b, l + 1);
+ return true;
+ }
+
+ // PIPE functionCall
+ private static boolean functionCall_5_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCall_5_0")) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, PIPE);
+ r = r && functionCall(b, l + 1);
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // ((IDENTIFIER COLON variableValue) | variableValue)[COMMA]
+ public static boolean functionCallParam(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "functionCallParam")) return false;
+ boolean r;
+ Marker m = enter_section_(b, l, _NONE_, FUNCTION_CALL_PARAM, "Documentation
]]>
-