Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nixexpr.hh File Reference
#include <map>
#include <vector>
#include "lix/libexpr/value.hh"
#include "lix/libexpr/symbol-table.hh"
#include "lix/libutil/error.hh"
#include "lix/libutil/json.hh"
#include "lix/libutil/position.hh"
#include "lix/libexpr/eval-error.hh"
#include "lix/libexpr/pos-idx.hh"
#include "lix/libexpr/pos-table.hh"
#include "lix/libutil/strings.hh"
Include dependency graph for nixexpr.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nix::AttrName
 
struct  nix::Expr
 
struct  nix::Expr::AstSymbols
 
struct  nix::ExprLiteral
 
struct  nix::ExprString
 
struct  nix::ExprPath
 
struct  nix::ExprVar
 
struct  nix::ExprInheritFrom
 
struct  nix::ExprSelect
 
struct  nix::ExprOpHasAttr
 
struct  nix::ExprAttrs
 
struct  nix::ExprAttrs::AttrDef
 
struct  nix::ExprAttrs::DynamicAttrDef
 
struct  nix::ExprSet
 
struct  nix::ExprList
 
struct  nix::Pattern
 
struct  nix::SimplePattern
 
struct  nix::AttrsPattern
 
struct  nix::AttrsPattern::Formal
 
struct  nix::ExprLambda
 
struct  nix::ExprCall
 
struct  nix::ExprLet
 
struct  nix::ExprWith
 
struct  nix::ExprIf
 
struct  nix::ExprAssert
 
struct  nix::ExprOpNot
 
struct  nix::ExprPos
 
struct  nix::ExprBlackHole
 
struct  nix::StaticEnv
 

Macros

#define COMMON_METHODS
 
#define MakeBinOp(name, s)
 

Typedefs

typedef std::vector< AttrNamenix::AttrPath
 
typedef uint32_t nix::Level
 
typedef uint32_t nix::Displacement
 

Functions

std::string nix::showAttrPath (const SymbolTable &symbols, const AttrPath &attrPath)
 
JSON nix::printAttrPathToJson (const SymbolTable &symbols, const AttrPath &attrPath)
 
 nix::MakeBinOp (ExprOpEq, "==") MakeBinOp(ExprOpNEq
 

Macro Definition Documentation

◆ COMMON_METHODS

#define COMMON_METHODS
Value:
JSON toJSON(const SymbolTable & symbols) const override; \
void eval(EvalState & state, Env & env, Value & v) override; \
void bindVars(Evaluator & es, const std::shared_ptr<const StaticEnv> & env) override;

◆ MakeBinOp

#define MakeBinOp ( name,
s )
Value:
struct name : Expr \
{ \
std::unique_ptr<Expr> e1, e2; \
name(std::unique_ptr<Expr> e1, std::unique_ptr<Expr> e2) : e1(std::move(e1)), e2(std::move(e2)) { }; \
name(const PosIdx & pos, std::unique_ptr<Expr> e1, std::unique_ptr<Expr> e2) : Expr(pos), e1(std::move(e1)), e2(std::move(e2)) { }; \
JSON toJSON(const SymbolTable & symbols) const override \
{ \
return { \
{"_type", #name}, \
{"e1", e1->toJSON(symbols)}, \
{"e2", e2->toJSON(symbols)} \
};\
} \
void bindVars(Evaluator & es, const std::shared_ptr<const StaticEnv> & env) override \
{ \
e1->bindVars(es, env); e2->bindVars(es, env); \
} \
void eval(EvalState & state, Env & env, Value & v) override; \
};