Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::lang Namespace Reference

Classes

struct  CodeLocation
 Location of a character in a program. More...
class  ErrorReporter
 Utility class for reporting errors in the source code. More...
class  FomParser
 Parses HLA FOM files. More...
struct  StlUnaryExpr
 Unary operation. More...
struct  StlBinaryExpr
 Binary expression. More...
struct  StlLiteralExpr
 Literals. More...
struct  StlGroupingExpr
 Groups. More...
struct  StlLogicalExpr
 Binary logical operation. More...
struct  StlVariableExpr
 A variable. More...
struct  StlBetweenExpr
 A BETWEEN expression. More...
struct  StlInExpr
 A IN expression. More...
struct  StlExpr
 Wrapper for expression values. More...
class  StlParser
 Parses STL types and queries out of a list of tokens. More...
struct  TypeSet
 A set of types coming from a STL file. More...
struct  ResolverContext
 The environment where a resolution takes place. More...
class  TypeSetContext
 The set of types used during resolution. More...
struct  ClassAnnotations
struct  TypeSettings
class  StlResolver
 Resolves a list of statements into a set of types. More...
class  StlScanner
 Converts a string into a list of tokens. More...
struct  StlImportStatement
struct  StlPackageStatement
struct  StlAttribute
struct  StlTypeNameStatement
struct  StlStructFieldStatement
struct  StlStructStatement
struct  StlEnumeratorStatement
struct  StlEnumStatement
struct  StlVariantElement
struct  StlVariantStatement
struct  StlQuantityStatement
struct  StlSequenceStatement
struct  StlArrayStatement
struct  StlTypeAliasStatement
struct  StlOptionalTypeStatement
struct  StlArgStatement
struct  StlVarStatement
struct  StlFunctionStatement
struct  StlEventStatement
struct  StlInterfaceStatement
struct  StlClassStatement
struct  BusNameStatement
struct  QueryStatement
struct  StlToken
struct  VariantAccessError
 Represents a variant that could not be accessed. More...
class  Chunk
 A chunk of byte code. It holds code and constants needed by the code. Constants are accessed by index. More...
class  VM
 Virtual machine for executing Sen byte code. More...
struct  FomDocument
struct  ParsedDoc
class  FomDocumentSet

Typedefs

using StlExprVal
 A variant supporting all expressions.
using StlAttributeList = std::vector<StlAttribute>
using StlStatement
using StlTokenList = std::vector<StlToken>
using Value
 A value that can be in the stack.
using ValueGetter = std::function<Value()>
 Gets a value from some source.
using Environment = Span<ValueGetter>
 The environment is an indexed list of value getter functions.

Enumerations

enum class  StlUnaryOperator { StlUnaryOperator::logicalNot , StlUnaryOperator::negate }
 An operator on a single term. More...
enum class  StlBinaryOperator {
  StlBinaryOperator::add , StlBinaryOperator::subtract , StlBinaryOperator::multiply , StlBinaryOperator::divide ,
  StlBinaryOperator::lt , StlBinaryOperator::le , StlBinaryOperator::gt , StlBinaryOperator::ge ,
  StlBinaryOperator::eq , StlBinaryOperator::ne
}
 Kinds of binary operations. More...
enum class  StlLogicalOperator { StlLogicalOperator::logicalAnd , StlLogicalOperator::logicalOr }
 Logic. More...
enum class  StlTokenType {
  StlTokenType::leftParen , StlTokenType::rightParen , StlTokenType::leftBrace , StlTokenType::rightBrace ,
  StlTokenType::leftBracket , StlTokenType::rightBracket , StlTokenType::comma , StlTokenType::dot ,
  StlTokenType::minus , StlTokenType::plus , StlTokenType::colon , StlTokenType::semicolon ,
  StlTokenType::slash , StlTokenType::star , StlTokenType::at , StlTokenType::bang ,
  StlTokenType::bangEqual , StlTokenType::equal , StlTokenType::equalEqual , StlTokenType::greater ,
  StlTokenType::greaterEqual , StlTokenType::less , StlTokenType::lessEqual , StlTokenType::identifier ,
  StlTokenType::string , StlTokenType::real , StlTokenType::integral , StlTokenType::keywordAbstract ,
  StlTokenType::keywordAnd , StlTokenType::keywordClass , StlTokenType::keywordInterface , StlTokenType::keywordExtends ,
  StlTokenType::keywordImplements , StlTokenType::keywordStruct , StlTokenType::keywordVariant , StlTokenType::keywordFalse ,
  StlTokenType::keywordFunction , StlTokenType::keywordEvent , StlTokenType::keywordVar , StlTokenType::keywordOr ,
  StlTokenType::keywordNot , StlTokenType::keywordTrue , StlTokenType::keywordImport , StlTokenType::keywordOptional ,
  StlTokenType::keywordPackage , StlTokenType::keywordEnum , StlTokenType::keywordSequence , StlTokenType::keywordArray ,
  StlTokenType::keywordQuantity , StlTokenType::keywordAlias , StlTokenType::keywordSelect , StlTokenType::keywordWhere ,
  StlTokenType::keywordFrom , StlTokenType::keywordIn , StlTokenType::keywordBetween , StlTokenType::comment ,
  StlTokenType::endOfFile
}
 Supported tokens. More...
enum  OpCode : uint8_t {
  opReturn = 0 , opConstant = 1 , opNegate = 2 , opAdd = 3 ,
  opSub = 4 , opMul = 5 , opDiv = 6 , opEqual = 7 ,
  opNotEqual = 8 , opGreaterThan = 9 , opGreaterOrEqualThan = 10 , opLowerThan = 11 ,
  opLowerOrEqualThan = 12 , opAnd = 13 , opOr = 14 , opJumpIfTrue = 15 ,
  opJumpIfFalse = 16 , opFetchVariable = 17 , opBetween = 18
}
 Instructions that can be executed by the virtual machine. More...

Functions

TypeSetContext parseFomDocuments (const std::vector< std::filesystem::path > &paths, const std::vector< std::filesystem::path > &mappings, const TypeSettings &settings)
const TypeSetreadTypesFile (const std::filesystem::path &fileName, const std::vector< std::filesystem::path > &includePaths, TypeSetContext &globalTypeSetContext, const TypeSettings &settings, std::string_view from={})
 Helper function to use the resolver.
std::string toString (const StlToken &token)
std::string toString (StlTokenType type)
template<typename T>
extract (const Value &value)
 Get T out of the value variant.
template<typename T>
bool holds (const Value &value) noexcept
 True if the variant holds T.

Variables

constexpr std::size_t stackMax = 256U

Class Documentation

◆ sen::lang::FomDocument

struct sen::lang::FomDocument
Class Members
path filePath
xml_document xmlDoc
string name
string packageName
vector< FomDocument * > deps
vector< FomDocument * > mappingDeps
vector< xml_node > definedClassesNodes
vector< xml_node > definedInteractionNodes

◆ sen::lang::ParsedDoc

struct sen::lang::ParsedDoc
Class Members
FomDocument * doc
CustomTypeRegistry registry
vector< ConstTypeHandle<> > storage