as2js: as2js Namespace Reference

as2js Namespace Reference

The AlexScript to JavaScript namespace. More...

Namespaces  anonymous_namespace{compiler_package.cpp}    anonymous_namespace{json.cpp}  Private implementation functions.
   anonymous_namespace{lexer.cpp}  The Lexer private functions to handle character types.
   anonymous_namespace{message.cpp}    anonymous_namespace{node_attribute.cpp}  Anonymous namespace for attribute internal definitions.
   anonymous_namespace{node_operator.cpp}  Internal structures and tables used to do operator conversions.
   anonymous_namespace{node_type.cpp}  Private definitions of the node type.
   anonymous_namespace{rc.cpp}    compare_utils    Optimizer    optimizer_details  The optimizer sub-namespace.
  Classes class  Compiler   class  Database   class  DecodingFilter   class  DecodingFilterDetect   class  DecodingFilterISO88591   class  DecodingFilterUTF16   class  DecodingFilterUTF16BE   class  DecodingFilterUTF16LE   class  DecodingFilterUTF32BE   class  DecodingFilterUTF32LE   class  DecodingFilterUTF8   class  exception_already_defined   class  exception_cannot_open_file   class  exception_cyclical_structure   class  exception_exit   class  exception_file_already_open   class  exception_incompatible_node_data   class  exception_incompatible_node_type   class  exception_index_out_of_range   class  exception_internal_error   class  exception_invalid_data   class  exception_invalid_float   class  exception_invalid_index   class  exception_locked_node   class  exception_no_parent   class  FileInput   class  FileOutput   class  Float64   class  Input   class  InputRetriever   class  Int64   class  JSON   class  Lexer   class  Message   class  MessageCallback   class  Node   class  NodeLock   class  Options   class  Output   class  Parser   class  Position   class  raii_stream_flags  A class used to safely handle stream flags, width, and precision. More...
  class  rc_t   class  StandardInput   class  StandardOutput   class  String   class  StringInput   class  StringOutput   Typedefs typedef int32_t as_char_t   typedef std::vector< Node::pointer_tnode_pointer_vector_t   Enumerations enum  compare_t {
  compare_t::COMPARE_EQUAL = 0,
  compare_t::COMPARE_GREATER = 1,
  compare_t::COMPARE_LESS = -1,
  compare_t::COMPARE_UNORDERED = 2,
  compare_t::COMPARE_ERROR = -2,
  compare_t::COMPARE_UNDEFINED = -3
}   enum  err_code_t {
  err_code_t::AS_ERR_NONE = 0,
  err_code_t::AS_ERR_ABSTRACT,
  err_code_t::AS_ERR_BAD_NUMERIC_TYPE,
  err_code_t::AS_ERR_BAD_PRAGMA,
  err_code_t::AS_ERR_CANNOT_COMPILE,
  err_code_t::AS_ERR_CANNOT_MATCH,
  err_code_t::AS_ERR_CANNOT_OVERLOAD,
  err_code_t::AS_ERR_CANNOT_OVERWRITE_CONST,
  err_code_t::AS_ERR_CASE_LABEL,
  err_code_t::AS_ERR_COLON_EXPECTED,
  err_code_t::AS_ERR_COMMA_EXPECTED,
  err_code_t::AS_ERR_CURVLY_BRACKETS_EXPECTED,
  err_code_t::AS_ERR_DEFAULT_LABEL,
  err_code_t::AS_ERR_DIVIDE_BY_ZERO,
  err_code_t::AS_ERR_DUPLICATES,
  err_code_t::AS_ERR_DYNAMIC,
  err_code_t::AS_ERR_EXPRESSION_EXPECTED,
  err_code_t::AS_ERR_FINAL,
  err_code_t::AS_ERR_IMPROPER_STATEMENT,
  err_code_t::AS_ERR_INACCESSIBLE_STATEMENT,
  err_code_t::AS_ERR_INCOMPATIBLE,
  err_code_t::AS_ERR_INCOMPATIBLE_PRAGMA_ARGUMENT,
  err_code_t::AS_ERR_INSTALLATION,
  err_code_t::AS_ERR_INSTANCE_EXPECTED,
  err_code_t::AS_ERR_INTERNAL_ERROR,
  err_code_t::AS_ERR_NATIVE,
  err_code_t::AS_ERR_INVALID_ARRAY_FUNCTION,
  err_code_t::AS_ERR_INVALID_ATTRIBUTES,
  err_code_t::AS_ERR_INVALID_CATCH,
  err_code_t::AS_ERR_INVALID_CLASS,
  err_code_t::AS_ERR_INVALID_CONDITIONAL,
  err_code_t::AS_ERR_INVALID_DEFINITION,
  err_code_t::AS_ERR_INVALID_DO,
  err_code_t::AS_ERR_INVALID_ENUM,
  err_code_t::AS_ERR_INVALID_EXPRESSION,
  err_code_t::AS_ERR_INVALID_FIELD,
  err_code_t::AS_ERR_INVALID_FIELD_NAME,
  err_code_t::AS_ERR_INVALID_FRAME,
  err_code_t::AS_ERR_INVALID_FUNCTION,
  err_code_t::AS_ERR_INVALID_GOTO,
  err_code_t::AS_ERR_INVALID_IMPORT,
  err_code_t::AS_ERR_INVALID_INPUT_STREAM,
  err_code_t::AS_ERR_INVALID_KEYWORD,
  err_code_t::AS_ERR_INVALID_LABEL,
  err_code_t::AS_ERR_INVALID_NAMESPACE,
  err_code_t::AS_ERR_INVALID_NODE,
  err_code_t::AS_ERR_INVALID_NUMBER,
  err_code_t::AS_ERR_INVALID_OPERATOR,
  err_code_t::AS_ERR_INVALID_PACKAGE_NAME,
  err_code_t::AS_ERR_INVALID_PARAMETERS,
  err_code_t::AS_ERR_INVALID_REST,
  err_code_t::AS_ERR_INVALID_RETURN_TYPE,
  err_code_t::AS_ERR_INVALID_SCOPE,
  err_code_t::AS_ERR_INVALID_TRY,
  err_code_t::AS_ERR_INVALID_TYPE,
  err_code_t::AS_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE,
  err_code_t::AS_ERR_INVALID_VARIABLE,
  err_code_t::AS_ERR_IO_ERROR,
  err_code_t::AS_ERR_LABEL_NOT_FOUND,
  err_code_t::AS_ERR_LOOPING_REFERENCE,
  err_code_t::AS_ERR_MISMATCH_FUNC_VAR,
  err_code_t::AS_ERR_MISSSING_VARIABLE_NAME,
  err_code_t::AS_ERR_NEED_CONST,
  err_code_t::AS_ERR_NOT_ALLOWED,
  err_code_t::AS_ERR_NOT_ALLOWED_IN_STRICT_MODE,
  err_code_t::AS_ERR_NOT_FOUND,
  err_code_t::AS_ERR_NOT_SUPPORTED,
  err_code_t::AS_ERR_OBJECT_MEMBER_DEFINED_TWICE,
  err_code_t::AS_ERR_PARENTHESIS_EXPECTED,
  err_code_t::AS_ERR_PRAGMA_FAILED,
  err_code_t::AS_ERR_SEMICOLON_EXPECTED,
  err_code_t::AS_ERR_SQUARE_BRACKETS_EXPECTED,
  err_code_t::AS_ERR_STRING_EXPECTED,
  err_code_t::AS_ERR_STATIC,
  err_code_t::AS_ERR_TYPE_NOT_LINKED,
  err_code_t::AS_ERR_UNKNOWN_ESCAPE_SEQUENCE,
  err_code_t::AS_ERR_UNKNOWN_OPERATOR,
  err_code_t::AS_ERR_UNTERMINATED_STRING,
  err_code_t::AS_ERR_UNEXPECTED_EOF,
  err_code_t::AS_ERR_UNEXPECTED_PUNCTUATION,
  err_code_t::AS_ERR_UNEXPECTED_TOKEN,
  err_code_t::AS_ERR_UNEXPECTED_DATABASE,
  err_code_t::AS_ERR_UNEXPECTED_RC,
  err_code_t::AS_ERR_max
}   enum  message_level_t {
  message_level_t::MESSAGE_LEVEL_OFF,
  message_level_t::MESSAGE_LEVEL_FATAL,
  message_level_t::MESSAGE_LEVEL_ERROR,
  message_level_t::MESSAGE_LEVEL_WARNING,
  message_level_t::MESSAGE_LEVEL_INFO,
  message_level_t::MESSAGE_LEVEL_DEBUG,
  message_level_t::MESSAGE_LEVEL_TRACE
}   Functions char const * as2js_library_version ()  Return the library version. More...
  bool operator!= (char const *str, String const &string)  Compare a String against a char const * string. More...
  std::ostream & operator<< (std::ostream &out, Position const &pos)  Print this position in the out stream. More...
  std::ostream & operator<< (std::ostream &out, Node const &node)  Send a node to the specified output stream. More...
  std::ostream & operator<< (std::ostream &out, String const &str)  Send string to output stream. More...
  bool operator== (char const *str, String const &string)  Compare a String against a char const * string. More...
  Detailed Description

All the definitions from the as2js compiler are found inside this namespace. There are other sub-namespaces used here and there, but this is the major one.

Of course, we use a few #define and those are not protected with a namespace. All of the #define should start with AS2JS_ though, to avoid potential conflicts.

Typedef Documentation
typedef int32_t as2js::as_char_t

Definition at line 47 of file string.h.

Definition at line 634 of file node.h.

Enumeration Type Documentation
enum as2js::compare_t strong
EnumeratorCOMPARE_EQUAL  COMPARE_GREATER  COMPARE_LESS  COMPARE_UNORDERED  COMPARE_ERROR  COMPARE_UNDEFINED 

Definition at line 41 of file compare.h.

enum as2js::err_code_t strong
EnumeratorAS_ERR_NONE  AS_ERR_ABSTRACT  AS_ERR_BAD_NUMERIC_TYPE  AS_ERR_BAD_PRAGMA  AS_ERR_CANNOT_COMPILE  AS_ERR_CANNOT_MATCH  AS_ERR_CANNOT_OVERLOAD  AS_ERR_CANNOT_OVERWRITE_CONST  AS_ERR_CASE_LABEL  AS_ERR_COLON_EXPECTED  AS_ERR_COMMA_EXPECTED  AS_ERR_CURVLY_BRACKETS_EXPECTED  AS_ERR_DEFAULT_LABEL  AS_ERR_DIVIDE_BY_ZERO  AS_ERR_DUPLICATES  AS_ERR_DYNAMIC  AS_ERR_EXPRESSION_EXPECTED  AS_ERR_FINAL  AS_ERR_IMPROPER_STATEMENT  AS_ERR_INACCESSIBLE_STATEMENT  AS_ERR_INCOMPATIBLE  AS_ERR_INCOMPATIBLE_PRAGMA_ARGUMENT  AS_ERR_INSTALLATION  AS_ERR_INSTANCE_EXPECTED  AS_ERR_INTERNAL_ERROR  AS_ERR_NATIVE  AS_ERR_INVALID_ARRAY_FUNCTION  AS_ERR_INVALID_ATTRIBUTES  AS_ERR_INVALID_CATCH  AS_ERR_INVALID_CLASS  AS_ERR_INVALID_CONDITIONAL  AS_ERR_INVALID_DEFINITION  AS_ERR_INVALID_DO  AS_ERR_INVALID_ENUM  AS_ERR_INVALID_EXPRESSION  AS_ERR_INVALID_FIELD  AS_ERR_INVALID_FIELD_NAME  AS_ERR_INVALID_FRAME  AS_ERR_INVALID_FUNCTION  AS_ERR_INVALID_GOTO  AS_ERR_INVALID_IMPORT  AS_ERR_INVALID_INPUT_STREAM  AS_ERR_INVALID_KEYWORD  AS_ERR_INVALID_LABEL  AS_ERR_INVALID_NAMESPACE  AS_ERR_INVALID_NODE  AS_ERR_INVALID_NUMBER  AS_ERR_INVALID_OPERATOR  AS_ERR_INVALID_PACKAGE_NAME  AS_ERR_INVALID_PARAMETERS  AS_ERR_INVALID_REST  AS_ERR_INVALID_RETURN_TYPE  AS_ERR_INVALID_SCOPE  AS_ERR_INVALID_TRY  AS_ERR_INVALID_TYPE  AS_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE  AS_ERR_INVALID_VARIABLE  AS_ERR_IO_ERROR  AS_ERR_LABEL_NOT_FOUND  AS_ERR_LOOPING_REFERENCE  AS_ERR_MISMATCH_FUNC_VAR  AS_ERR_MISSSING_VARIABLE_NAME  AS_ERR_NEED_CONST  AS_ERR_NOT_ALLOWED  AS_ERR_NOT_ALLOWED_IN_STRICT_MODE  AS_ERR_NOT_FOUND  AS_ERR_NOT_SUPPORTED  AS_ERR_OBJECT_MEMBER_DEFINED_TWICE  AS_ERR_PARENTHESIS_EXPECTED  AS_ERR_PRAGMA_FAILED  AS_ERR_SEMICOLON_EXPECTED  AS_ERR_SQUARE_BRACKETS_EXPECTED  AS_ERR_STRING_EXPECTED  AS_ERR_STATIC  AS_ERR_TYPE_NOT_LINKED  AS_ERR_UNKNOWN_ESCAPE_SEQUENCE  AS_ERR_UNKNOWN_OPERATOR  AS_ERR_UNTERMINATED_STRING  AS_ERR_UNEXPECTED_EOF  AS_ERR_UNEXPECTED_PUNCTUATION  AS_ERR_UNEXPECTED_TOKEN  AS_ERR_UNEXPECTED_DATABASE  AS_ERR_UNEXPECTED_RC  AS_ERR_max 

Definition at line 59 of file message.h.

EnumeratorMESSAGE_LEVEL_OFF  MESSAGE_LEVEL_FATAL  MESSAGE_LEVEL_ERROR  MESSAGE_LEVEL_WARNING  MESSAGE_LEVEL_INFO  MESSAGE_LEVEL_DEBUG  MESSAGE_LEVEL_TRACE 

Definition at line 47 of file message.h.

Function Documentation
char const * as2js::as2js_library_version ( )

This function can be used to get the current version of the as2js library. It returns a string of the form:

<major>.<minor>.<release>

where each entry is a number (only numerics are used.)

Note that this is different from using the AS2JS_VERSION macro (defined in as2js.h) in that the macro defines the version you are compiling against and not automatically the version that your code will run against.

Todo:
Add another function that checks whether your code is compatible with this library.
Returns
The version of the loaded library.

Definition at line 152 of file version.cpp.

References AS2JS_VERSION.

Referenced by as2js_compiler::as2js_compiler().

bool as2js::operator!= ( char const *  str, String const &  string  )

This function compares an ISO-8859-1 string against a String. If you have a UTF-8 string, make sure to use from_utf8() first and then compare the two String's against each other.

Parameters
[in]strThe string to compare as ISO-8859-1. [in]stringThe String to compare with.
Returns
true if both strings are not equal.

Definition at line 960 of file string.cpp.

std::ostream & as2js::operator<< ( std::ostream &  out, Position const &  pos  )

This function prints out this position in the out stream. We limit the printing to the filename and the line number as most compilers do. The other information is available for you to print additional data if required.

<filename>:<line>:
Parameters
[in,out]outThe stream to print to. [in]posThe position to print in the output.
Returns
A reference to this stream.

Definition at line 236 of file position.cpp.

References as2js::Position::get_filename(), and as2js::Position::get_line().

std::ostream & as2js::operator<< ( std::ostream &  out, Node const &  node  )

This function prints a node to the output stream. The printing is very technical and mainly used to debug the node tree while parsing, compiling, optimizing, and generating the final output.

Parameters
[in,out]outThe output stream. [in]nodeThe node to print in the output stream.
Returns
A reference to the output stream.

Definition at line 588 of file node_display.cpp.

References as2js::Node::display().

Referenced by as2js::Message::operator<<().

std::ostream & as2js::operator<< ( std::ostream &  out, String const &  str  )

This function sends this String to the specified output buffer. It is to ease the output of a string to stream such as std::cout and std::cerr.

Parameters
[in,out]outStream where the string is printed. [in]strThe string to be printed out.
Returns
A reference to the out stream.

Definition at line 1496 of file string.cpp.

References as2js::String::to_utf8().

bool as2js::operator== ( char const *  str, String const &  string  )

This function compares an ISO-8859-1 string against a String. If you have a UTF-8 string, make sure to use from_utf8() first and then compare the two String's against each other.

Parameters
[in]strThe string to compare as ISO-8859-1. [in]stringThe String to compare with.
Returns
true if both strings are equal.

Definition at line 925 of file string.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly