declaration
        : ident S* ':' S* expr prio?
        | /* empty */
        ;
548205
def _parseDeclaration(self, src):
        
        # property
        propertyName, src = self._getIdent(src)

        if propertyName is not None:
            src = src.lstrip()
            # S* : S*
            if src[:1] in (':', '='):
                # Note: we are being fairly flexable here...  technically, the
                # ":" is *required*, but in the name of flexibility we
                # suppor a null transition, as well as an "=" transition
                src = src[1:].lstrip()

            src, property = self._parseDeclarationProperty(src, propertyName)
        else:
            property = None

        return src, property
175575
private String checkProcedureIdentifier(
            final String identifier, final String statement
            ) throws VoltCompilerException {
        String retIdent = checkIdentifierStart(identifier, statement);
        if (retIdent.contains(".")) {
            String msg = String.format(
                "Invalid procedure name containing dots \"%s\" in DDL: \"%s\"",
                identifier, statement.substring(0,statement.length()-1));
            throw m_compiler.new VoltCompilerException(msg);
        }
        return retIdent;
    }
1107612
function isDeclarationOfFunctionExpression(s) {
        if (s.valueDeclaration && s.valueDeclaration.kind === 218 /* VariableDeclaration */) {
            var declaration = s.valueDeclaration;
            return declaration.initializer && declaration.initializer.kind === 179 /* FunctionExpression */;
        }
        return false;
    }
1090768
def p_use_declaration(p):
    ''''''
    if len(p) == 2:
        p[0] = ast.UseDeclaration(p[1], None, lineno=p.lineno(1))
    elif len(p) == 3:
        p[0] = ast.UseDeclaration(p[1] + p[2], None, lineno=p.lineno(1))
    elif len(p) == 4:
        p[0] = ast.UseDeclaration(p[1], p[3], lineno=p.lineno(2))
    else:
        p[0] = ast.UseDeclaration(p[1] + p[2], p[4], lineno=p.lineno(1))
1032948
@SuppressWarnings("fallthrough")
    protected void identifier() throws ParseException {
        skipWhitespace();
        int pos = bp;

        if (isJavaIdentifierStart(ch)) {
            readJavaIdentifier();
            return;
        }

        throw new ParseException("dc.identifier.expected");
    }
147226
void declarePrefix (String prefix, String uri)
    {
                                // Lazy processing...
        if (!tablesDirty) {
            copyTables();
        }
        if (declarations == null) {
            declarations = new Vector();
        }
            
        prefix = prefix.intern();
        uri = uri.intern();
        if ("".equals(prefix)) {
            if ("".equals(uri)) {
                defaultNS = null;
            } else {
                defaultNS = uri;
            }
        } else {
            prefixTable.put(prefix, uri);
            uriTable.put(uri, prefix); // may wipe out another prefix
        }
        declarations.addElement(prefix);
    }
10293
def p_expr_post_incdec(p):
    ''''''
    p[0] = ast.PostIncDecOp(p[2], p[1], lineno=p.lineno(2))
637894
function parseSignature (sig) {
  var tmp = /^(\w+)\((.*)\)$/.exec(sig)

  if (tmp.length !== 3) {
    throw new Error('Invalid method signature')
  }

  var args = /^(.+)\):\((.+)$/.exec(tmp[2])

  if (args !== null && args.length === 3) {
    return {
      method: tmp[1],
      args: args[1].split(','),
      retargs: args[2].split(',')
    }
  } else {
    var params = tmp[2].split(',')
    if (params.length === 1 && params[0] === '') {
      // Special-case (possibly naive) fixup for functions that take no arguments.
      // TODO: special cases are always bad, but this makes the function return
      // match what the calling functions expect
      params = []
    }
    return {
      method: tmp[1],
      args: params
    }
  }
}
309636
def p_if_expr_header(p):
    
    global ENABLED

    IFDEFS.append((ENABLED, p.lineno(1)))
    ENABLED = bool(int(p[2])) if p[2].isdigit() else ID_TABLE.defined(p[2])
379601
function declaration() {
    var pos = position();

    // prop
    var prop = match(/^(\*?[-#\/\*\w\.]+(\[[0-9a-z_-]+\])?)\s*/);
    if (!prop) return;
    prop = trim(prop[0]);

    // :
    if (!match(/^:\s*/)) return error("property missing ':'");


    // XXX: A hack to parse { prop: {x} }
    var tillEOL = /(.*)\n/.exec(css);
    if (tillEOL && tillEOL[1].length > 0) {
      var lEscCount = tillEOL[1].match(/{/g);
      var rEscCount = tillEOL[1].match(/}/g);
      lEscCount = lEscCount ? lEscCount.length : lEscCount; 
      rEscCount = rEscCount ? rEscCount.length : rEscCount; 

      if (lEscCount < rEscCount) {
        var re = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^;])+)/;
        var local = css.substring(0, tillEOL[1].lastIndexOf('}'));
        var val = re.exec(local);
        if (!val) return error('property missing value');
        var str = val[0];
        updatePosition(str);
        css = css.slice(str.length);

        var ret = pos({
          type: 'declaration',
          property: prop,
          value: trim(str)
        });

        // ;
        match(/^[;\s]*/);

        return ret;
      }
    }
    // XXX: End of hack

    // val
    var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^\n;])+)/);
    if (!val) return error('property missing value');

    var ret = pos({
      type: 'declaration',
      property: prop,
      value: trim(val[0])
    });

    // ;
    match(/^[;\s]*/);

    return ret;
  }
1104410
function parseVariableIdentifier() {
        var token, startToken;

        startToken = lookahead;
        token = lex();

        if (token.type !== Token.Identifier) {
            throwUnexpected(token);
        }

        return delegate.markEnd(delegate.createIdentifier(token.value), startToken);
    }
1246383
private static Expression symbolWithNamespace(String requireSymbol, String fullyQualifiedSymbol) {
    GoogRequire require = GoogRequire.create(requireSymbol);
    if (fullyQualifiedSymbol.equals(require.symbol())) {
      return require.reference();
    }
    String ident = fullyQualifiedSymbol.substring(require.symbol().length() + 1);
    return require.dotAccess(ident);
  }
315125
private void parseNotationDecl() throws Exception {
        String nname;
        ExternalIdentifiers ids;

        requireWhitespace();
        nname = readNmtoken(true);
        // NE08
        if (nname.indexOf(':') >= 0) {
            fatal("Illegal character(':') in notation name ", nname, null);
        }
        requireWhitespace();

        // Read the external identifiers.
        ids = readExternalIds(true, false);

        // Register the notation.
        setNotation(nname, ids);

        skipWhitespace();
        require('>');
    }
18656
function getDeclaration1() {
  const type = NodeType.DeclarationType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  content.push(getProperty());
  if (checkS(pos)) content.push(getS());
  content.push(getPropertyDelim());
  if (checkS(pos)) content.push(getS());
  content.push(getValue());

  return newNode(type, content, line, column);
}
206003
public final void identifierSuffix() throws RecognitionException {
		Token LEFT_SQUARE16=null;
		Token RIGHT_SQUARE17=null;
		Token DOT18=null;
		Token LEFT_SQUARE19=null;
		Token RIGHT_SQUARE20=null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:5: ( ( LEFT_SQUARE RIGHT_SQUARE )=> ( LEFT_SQUARE RIGHT_SQUARE )+ DOT class_key | ( ( LEFT_SQUARE )=> LEFT_SQUARE expression RIGHT_SQUARE )+ | arguments )
			int alt65=3;
			int LA65_0 = input.LA(1);
			if ( (LA65_0==LEFT_SQUARE) ) {
				int LA65_1 = input.LA(2);
				if ( (LA65_1==RIGHT_SQUARE) && (synpred33_DRL5Expressions())) {
					alt65=1;
				}
				else if ( (LA65_1==BOOL||(LA65_1 >= DECIMAL && LA65_1 <= DECR)||LA65_1==FLOAT||LA65_1==HEX||(LA65_1 >= ID && LA65_1 <= INCR)||(LA65_1 >= LEFT_PAREN && LA65_1 <= LESS)||LA65_1==MINUS||LA65_1==NEGATION||LA65_1==NULL||LA65_1==PLUS||(LA65_1 >= STAR && LA65_1 <= TIME_INTERVAL)) ) {
					alt65=2;
				}

				else {
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 65, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

			}
			else if ( (LA65_0==LEFT_PAREN) ) {
				alt65=3;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 65, 0, input);
				throw nvae;
			}

			switch (alt65) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:7: ( LEFT_SQUARE RIGHT_SQUARE )=> ( LEFT_SQUARE RIGHT_SQUARE )+ DOT class_key
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:35: ( LEFT_SQUARE RIGHT_SQUARE )+
					int cnt63=0;
					loop63:
					while (true) {
						int alt63=2;
						int LA63_0 = input.LA(1);
						if ( (LA63_0==LEFT_SQUARE) ) {
							alt63=1;
						}

						switch (alt63) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:36: LEFT_SQUARE RIGHT_SQUARE
							{
							LEFT_SQUARE16=(Token)match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_identifierSuffix3240); if (state.failed) return;
							if ( state.backtracking==0 ) { helper.emit(LEFT_SQUARE16, DroolsEditorType.SYMBOL); }
							RIGHT_SQUARE17=(Token)match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_identifierSuffix3281); if (state.failed) return;
							if ( state.backtracking==0 ) { helper.emit(RIGHT_SQUARE17, DroolsEditorType.SYMBOL); }
							}
							break;

						default :
							if ( cnt63 >= 1 ) break loop63;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(63, input);
							throw eee;
						}
						cnt63++;
					}

					DOT18=(Token)match(input,DOT,FOLLOW_DOT_in_identifierSuffix3325); if (state.failed) return;
					if ( state.backtracking==0 ) { helper.emit(DOT18, DroolsEditorType.SYMBOL); }
					pushFollow(FOLLOW_class_key_in_identifierSuffix3329);
					class_key();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:592:7: ( ( LEFT_SQUARE )=> LEFT_SQUARE expression RIGHT_SQUARE )+
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:592:7: ( ( LEFT_SQUARE )=> LEFT_SQUARE expression RIGHT_SQUARE )+
					int cnt64=0;
					loop64:
					while (true) {
						int alt64=2;
						int LA64_0 = input.LA(1);
						if ( (LA64_0==LEFT_SQUARE) ) {
							int LA64_36 = input.LA(2);
							if ( (synpred34_DRL5Expressions()) ) {
								alt64=1;
							}

						}

						switch (alt64) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:592:8: ( LEFT_SQUARE )=> LEFT_SQUARE expression RIGHT_SQUARE
							{
							LEFT_SQUARE19=(Token)match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_identifierSuffix3344); if (state.failed) return;
							if ( state.backtracking==0 ) { helper.emit(LEFT_SQUARE19, DroolsEditorType.SYMBOL); }
							pushFollow(FOLLOW_expression_in_identifierSuffix3374);
							expression();
							state._fsp--;
							if (state.failed) return;
							RIGHT_SQUARE20=(Token)match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_identifierSuffix3402); if (state.failed) return;
							if ( state.backtracking==0 ) { helper.emit(RIGHT_SQUARE20, DroolsEditorType.SYMBOL); }
							}
							break;

						default :
							if ( cnt64 >= 1 ) break loop64;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(64, input);
							throw eee;
						}
						cnt64++;
					}

					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:595:9: arguments
					{
					pushFollow(FOLLOW_arguments_in_identifierSuffix3418);
					arguments();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
1112891
function tokenize(sOption) {
		var iAt = 1, // The token's position for error messages; we count starting with 1
			sId,
			aMatches,
			sNext = sOption,
			iOffset,
			oToken,
			aTokens = [],
			sValue;

		while (sNext.length) {
			aMatches = rToken.exec(sNext);
			iOffset = 0;
			if (aMatches) {
				sValue = aMatches[0];
				if (aMatches[7]) {
					sId = "OPTION";
				} else if (aMatches[6] || aMatches[4]) {
					sId = "VALUE";
				} else if (aMatches[5]) {
					sId = "PATH";
					if (sValue === "false" || sValue === "true" || sValue === "null") {
						sId = "VALUE";
					} else if (sValue === "not") {
						sId = "not";
						aMatches = rNot.exec(sNext);
						if (aMatches) {
							sValue = aMatches[0];
						}
					}
				} else if (aMatches[3]) { // a %-escaped delimiter
					sId = unescape(aMatches[3]);
				} else if (aMatches[2]) { // an operator
					sId = aMatches[2];
					iOffset = aMatches[1].length;
				} else { // a delimiter
					sId = aMatches[0];
				}
				if (sId === '"') {
					sId = "VALUE";
					sValue = tokenizeDoubleQuotedString(sNext, sOption, iAt);
				} else if (sId === "'") {
					sId = "VALUE";
					sValue = tokenizeSingleQuotedString(sNext, sOption, iAt);
				}
				oToken = {
					at : iAt + iOffset,
					id : sId,
					value : sValue
				};
			} else {
				throw new SyntaxError("Unknown character '" + sNext[0] + "' at " + iAt + ": "
					+ sOption);
			}
			sNext = sNext.slice(sValue.length);
			iAt += sValue.length;
			aTokens.push(oToken);
		}

		return aTokens;
	}
1294844
Expr unary() {
		Tok tok = peek();
		switch (tok.sym) {
		case NOT:
			move();
			return new Logic(tok.sym, unary(), location);
		case ADD:
		case SUB:
			move();
			return new Unary(tok.sym, unary(), location).toConstIfPossible();
		case INC:
		case DEC:
			move();
			return new IncDec(tok.sym, false, incDec(), location);
		default:
			return incDec();
		}
	}