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

Classes

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

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 : uint8_t {
  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 , StlTokenType::unknown
}
 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 computePackagePrefix (const std::vector< std::string > &path)
 Joins a package path (e.g. ["sen", "components", "jsonrpc"]) into the dotted form used in STL declarations and qualified type names (e.g. sen.components.jsonrpc).
std::string toString (const StlToken &token)
std::string toString (StlTokenType type)
StlTokenType fromString (const std::string &stlTokenType)
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