Translate a constant declaration into WyAL. At the moment, this does nothing
because constant declarations are not supported in WyAL files.

@param declaration
The type declaration being translated.
@param wyalFile
The WyAL file being constructed
432931
private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
		if (decl.hasInitialiser()) {
			// The environments are needed to prevent clashes between variable
			// versions across verification conditions, and also to type variables
			// used in verification conditions.
			GlobalEnvironment globalEnvironment = new GlobalEnvironment(decl);
			LocalEnvironment localEnvironment = new LocalEnvironment(globalEnvironment);
			List<VerificationCondition> vcs = new ArrayList<>();
			Context context = new Context(wyalFile, AssumptionSet.ROOT, localEnvironment, localEnvironment, null, vcs);
			//
			Pair<Expr, Context> rp = translateExpressionWithChecks(decl.getInitialiser(), null, context);
			generateTypeInvariantCheck(decl.getType(), rp.first(), context);
			// Translate each generated verification condition into an assertion in
			// the underlying WyalFile.
			createAssertions(decl, vcs, globalEnvironment);
		}
	}
1103097
public void modified(ServiceReference<S> declarationBinderRef) throws InvalidFilterException {
        declarationBinders.get(declarationBinderRef).update(declarationBinderRef);
    }
913554
function splitDeclarations(declaration) {
            return fixer => declaration.declarations.map(declarator => {
                const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator);

                if (tokenAfterDeclarator === null) {
                    return null;
                }

                const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true });

                if (tokenAfterDeclarator.value !== ",") {
                    return null;
                }

                /*
                 * `var x,y`
                 * tokenAfterDeclarator ^^ afterComma
                 */
                if (afterComma.range[0] === tokenAfterDeclarator.range[1]) {
                    return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind} `);
                }

                /*
                 * `var x,
                 * tokenAfterDeclarator ^
                 *      y`
                 *      ^ afterComma
                 */
                if (
                    afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line ||
                    afterComma.type === "Line" ||
                    afterComma.type === "Block"
                ) {
                    let lastComment = afterComma;

                    while (lastComment.type === "Line" || lastComment.type === "Block") {
                        lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true });
                    }

                    return fixer.replaceTextRange(
                        [tokenAfterDeclarator.range[0], lastComment.range[0]],
                        `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} `
                    );
                }

                return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind}`);
            }).filter(x => x);
        }
90472
private WyalFile.VariableDeclaration[] generatePostconditionTypePattern(WyilFile.Decl.FunctionOrMethod declaration,
			LocalEnvironment environment) {
		Tuple<Decl.Variable> params = declaration.getParameters();
		Tuple<Decl.Variable> returns = declaration.getReturns();
		WyalFile.VariableDeclaration[] vars = new WyalFile.VariableDeclaration[params.size() + returns.size()];
		// second, set initial environment
		for (int i = 0; i != params.size(); ++i) {
			WyilFile.Decl.Variable var = params.get(i);
			vars[i] = environment.read(var);
		}
		for (int i = 0; i != returns.size(); ++i) {
			WyilFile.Decl.Variable var = returns.get(i);
			vars[i + params.size()] = environment.read(var);
		}
		//
		return vars;
	}
799581
@Descriptor("Gets info about the declarations available")
    public void declarations(@Descriptor("declarations [--type import|export]") String... parameters) {
        String type = getArgumentValue("--type", parameters);
        try {
            if ((type == null) || "import".equals(type)) {
                List<ServiceReference> allServiceRef = getAllServiceRefs(ImportDeclaration.class);
                displayDeclarationList(allServiceRef);
            }

            if ((type == null) || "export".equals(type)) {
                List<ServiceReference> allServiceRef = getAllServiceRefs(ExportDeclaration.class);
                displayDeclarationList(allServiceRef);
            }
        } catch (Exception e) {
            LOG.error("failed to execute command", e);
            print("failed to execute the command");
        }
    }
1152568
@Override
    public ClassNode visitTypeDeclaration(TypeDeclarationContext ctx) {
        if (asBoolean(ctx.classDeclaration())) { // e.g. class A {}
            ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitClassOrInterfaceModifiersOpt(ctx.classOrInterfaceModifiersOpt()));
            return configureAST(this.visitClassDeclaration(ctx.classDeclaration()), ctx);
        }

        throw createParsingFailedException("Unsupported type declaration: " + ctx.getText(), ctx);
    }
1325810
public void setLineTranslate( Float[] value) {
    PropertyValue propertyValue = lineTranslate(value);
    constantPropertyUsageMap.put(PROPERTY_LINE_TRANSLATE, propertyValue);
    layer.setProperties(propertyValue);
  }
74937
private D createAndRegisterDeclaration(Map<String, Object> metadata) {
        D declaration;
        if (klass.equals(ImportDeclaration.class)) {
            declaration = (D) ImportDeclarationBuilder.fromMetadata(metadata).build();
        } else if (klass.equals(ExportDeclaration.class)) {
            declaration = (D) ExportDeclarationBuilder.fromMetadata(metadata).build();
        } else {
            throw new IllegalStateException("");
        }
        declarationRegistrationManager.registerDeclaration(declaration);
        return declaration;
    }
1040564
@SuppressWarnings( "unchecked" )
    protected void processModifiersOfTypeDeclaration( AbstractTypeDeclaration typeDeclaration,
                                                      TypeMetadata classMetadata ) {
        List<IExtendedModifier> modifiers = typeDeclaration.modifiers();

        for (IExtendedModifier extendedModifier : modifiers) {
            if (extendedModifier.isAnnotation()) {
                if (extendedModifier instanceof MarkerAnnotation) {
                    MarkerAnnotation marker = (MarkerAnnotation)extendedModifier;
                    classMetadata.getAnnotations().add(AnnotationMetadata.markerAnnotation(JavaMetadataUtil.getName(marker.getTypeName())));
                }
            } else {
                Modifier modifier = (Modifier)extendedModifier;
                classMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
            }
        }
    }
368749
function processFile(idx, count, filename, data, parsedDeclarations, pluggable) {
  const declarations = parsedDeclarations.files[filename];
  // Inject dependent declaration extraction to last file
  const dependentDeclarations = idx === count - 1 ? parsedDeclarations.dependentDeclarations : [];
  const variables = { global: {} };

  const globalDeclarationResultHandler = (declaration, value, sassValue) => {
    if(!variables.global[declaration.declaration]) {
      variables.global[declaration.declaration] = [];
    }
    const variableValue = pluggable.run(Pluggable.POST_VALUE, { value, sassValue }).value;
    variables.global[declaration.declaration].push({ declaration, value: variableValue });
  }

  const fileId = getFileId(filename);
  const injection = injectExtractionFunctions(fileId, declarations, dependentDeclarations, { globalDeclarationResultHandler });
  const injectedData = `${data}\n\n${injection.injectedData}`;
  const injectedFunctions = injection.injectedFunctions;

  return {
    fileId,
    declarations,
    variables,
    injectedData,
    injectedFunctions,
  };
}
1324616
private Properties parseFile(File file) throws InvalidDeclarationFileException {
        Properties properties = new Properties();
        InputStream is = null;
        try {
            is = new FileInputStream(file);
            properties.load(is);
        } catch (Exception e) {
            throw new InvalidDeclarationFileException(String.format("Error reading declaration file %s", file.getAbsoluteFile()), e);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    LOG.error("IOException thrown while trying to close the declaration file.", e);
                }
            }
        }

        if (!properties.containsKey(Constants.ID)) {
            throw new InvalidDeclarationFileException(String.format("File %s is not a correct declaration, needs to contains an id property", file.getAbsoluteFile()));
        }
        return properties;
    }
473749
def parse_declaration_expressn(self, expressionAST, es, output_expressn=False):
        
        if not expressionAST:
            return None
        else:
            if isinstance(expressionAST, wdl_parser.Terminal):
                if expressionAST.str == 'boolean':
                    if expressionAST.source_string == 'false':
                        return 'False'
                    elif expressionAST.source_string == 'true':
                        return 'True'
                    else:
                        raise TypeError('Parsed boolean ({}) must be expressed as "true" or "false".'
                                        ''.format(expressionAST.source_string))
                elif expressionAST.str == 'string' and not output_expressn:
                    parsed_string = self.translate_wdl_string_to_python_string(expressionAST.source_string)
                    return '{string}'.format(string=parsed_string)
                else:
                    return '{string}'.format(string=expressionAST.source_string)
            elif isinstance(expressionAST, wdl_parser.Ast):
                if expressionAST.name == 'Add':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' + ')
                elif expressionAST.name == 'Subtract':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' - ')
                elif expressionAST.name == 'Multiply':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' * ')
                elif expressionAST.name == 'Divide':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' / ')
                elif expressionAST.name == 'GreaterThan':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' > ')
                elif expressionAST.name == 'LessThan':
                    es = es + self.parse_declaration_expressn_operator(expressionAST.attr('lhs'),
                                                                       expressionAST.attr('rhs'),
                                                                       es,
                                                                       operator=' < ')
                elif expressionAST.name == 'FunctionCall':
                    es = es + self.parse_declaration_expressn_fncall(expressionAST.attr('name'),
                                                                     expressionAST.attr('params'),
                                                                     es)
                elif expressionAST.name == 'TernaryIf':
                    es = es + self.parse_declaration_expressn_ternaryif(expressionAST.attr('cond'),
                                                                        expressionAST.attr('iftrue'),
                                                                        expressionAST.attr('iffalse'),
                                                                        es)
                elif expressionAST.name == 'MemberAccess':
                    es = es + self.parse_declaration_expressn_memberaccess(expressionAST.attr('lhs'),
                                                                           expressionAST.attr('rhs'),
                                                                           es)
                elif expressionAST.name == 'ArrayLiteral':
                    es = es + self.parse_declaration_expressn_arrayliteral(expressionAST.attr('values'),
                                                                           es)
                elif expressionAST.name == 'TupleLiteral':
                    es = es + self.parse_declaration_expressn_tupleliteral(expressionAST.attr('values'),
                                                                           es)
                elif expressionAST.name == 'ArrayOrMapLookup':
                    es = es + self.parse_declaration_expressn_arraymaplookup(expressionAST.attr('lhs'),
                                                                             expressionAST.attr('rhs'),
                                                                             es)
                elif expressionAST.name == 'LogicalNot':
                    es = es + self.parse_declaration_expressn_logicalnot(expressionAST.attr('expression'),
                                                                         es)
                else:
                    raise NotImplementedError
            elif isinstance(expressionAST, wdl_parser.AstList):
                raise NotImplementedError
            return '(' + es + ')'
554639
public MethodInfo addMethod(String declaration) {
        MethodDeclarationParser p = new MethodDeclarationParser(declaration);
        return addMethod(p.getModifiers(), p.getMethodName(),
                         p.getReturnType(), p.getParameters());
    }
1172076
public void checkDeclaration(Decl decl) {
		if (decl instanceof Decl.Unit) {
			checkUnit((Decl.Unit) decl);
		} else if (decl instanceof Decl.Import) {
			// Can ignore
		} else if (decl instanceof Decl.StaticVariable) {
			checkStaticVariableDeclaration((Decl.StaticVariable) decl);
		} else if (decl instanceof Decl.Type) {
			checkTypeDeclaration((Decl.Type) decl);
		} else if (decl instanceof Decl.FunctionOrMethod) {
			checkFunctionOrMethodDeclaration((Decl.FunctionOrMethod) decl);
		} else {
			checkPropertyDeclaration((Decl.Property) decl);
		}
	}
740707
public void defineConstantField(int modifier, String fieldName, int constant)
    {
        DeclaredType dt = (DeclaredType)asType();
        VariableBuilder builder = new VariableBuilder(this, fieldName, dt.getTypeArguments(), typeParameterMap);
        builder.addModifiers(modifier);
        builder.addModifier(Modifier.STATIC);
        builder.setType(Typ.IntA);
        FieldInfo fieldInfo = new FieldInfo(this, builder.getVariableElement(), new ConstantValue(this, constant));
        addFieldInfo(fieldInfo);
        fieldInfo.readyToWrite();
    }
1231885
@Modified(id = "importDeclarations")
    void modifiedImportDeclaration(ServiceReference<ImportDeclaration> importDeclarationSRef) {
        LOG.debug(linkerName + " : Modify the ImportDeclaration "
                + declarationsManager.getDeclaration(importDeclarationSRef));

        synchronized (lock) {
            declarationsManager.removeLinks(importDeclarationSRef);
            declarationsManager.modified(importDeclarationSRef);
            if (!declarationsManager.matched(importDeclarationSRef)) {
                return;
            }
            declarationsManager.createLinks(importDeclarationSRef);
        }
    }
1256835
function collectDeclarations (filePath) {
    const declarationRegexp = /(?:\$)([\w-]+)(?:[\s\n\r\t])*(?::)(?:[\s\n\r\t])*(.+)(?:[\s\n\r\t])*(?:;)/gm;
    const fileSource = fs.readFileSync(filePath, 'utf8');

    return fileSource.match(declarationRegexp);
}