ostrat.pParse

Type members

Classlikes

case class AsignExpr(left: Expr, asToken: AsignToken, right: Expr) extends ExprCompound
case class AsignToken(startPosn: TextPosn) extends ClauseMemberToken

A + or - infix Operator token

A + or - infix Operator token

trait BlockMember extends TextSpan

This trait includes all the tokens except braces plus the Bracket syntactic blocks. The Block in the name block member is either the top level statements in the file or the statements with in a bracket block. Conceptually the source file is considered a special case of bracket block where the beginning of substitutes for the opening bracket and the end of file substitutes for the closing bracket. BlockMember has only two sub traits StatementMember and SemiToken. So a sequence of TokenOrBlocks is simply a series of tokens which has been parsed into Blocks.

This trait includes all the tokens except braces plus the Bracket syntactic blocks. The Block in the name block member is either the top level statements in the file or the statements with in a bracket block. Conceptually the source file is considered a special case of bracket block where the beginning of substitutes for the opening bracket and the end of file substitutes for the closing bracket. BlockMember has only two sub traits StatementMember and SemiToken. So a sequence of TokenOrBlocks is simply a series of tokens which has been parsed into Blocks.

trait BlockMemberToken extends BlockMember with Token
trait BlockRaw
sealed trait Braces
sealed trait BracketCloseToken extends BracketToken

A closing bracket Token, The ']', ']' or ')' characters are BracketCloseTokens.

A closing bracket Token, The ']', ']' or ')' characters are BracketCloseTokens.

sealed trait BracketOpen extends BracketToken

An opening Brace, '{', '[' or '('.

An opening Brace, '{', '[' or '('.

sealed trait BracketToken extends Token
case class BracketedRaws(statements: Arr[TextSpan], braces: Braces, startBracket: TextPosn, endBracket: TextPosn)
case class BracketedStatements(statements: Statements, braces: Braces, startBracket: TextPosn, endBracket: TextPosn) extends BlockStatements
case class CharToken(startPosn: TextPosn, char: Char) extends ExprToken
case class Clause(expr: Expr, optComma: OptRef[CommaToken]) extends TextSpan

Statements in RCON can be unclaused or multi comma separated. The empty Clause just contains a comma. The comma at the end of the last Clause of a Statement is optional.

Statements in RCON can be unclaused or multi comma separated. The empty Clause just contains a comma. The comma at the end of the last Clause of a Statement is optional.

I think its helpful to have an expression member trait for syntax that is not expressions. So I don't think it would be helpful if say an opening brace was an expression. All Expressions are Expression members.

I think its helpful to have an expression member trait for syntax that is not expressions. So I don't think it would be helpful if say an opening brace was an expression. All Expressions are Expression members.

A Token that can be a member of a Clause.

A Token that can be a member of a Clause.

case class ClausedStatement(clauses: Arr[Clause], optSemi: OptRef[SemicolonToken]) extends Statement with TextSpanCompound

This statement has 1 or more comma separated clauses. If there is only 1 Clause, it must be terminated by a comma, otherwise the trailing comma on the last Clauses is optional.

This statement has 1 or more comma separated clauses. If there is only 1 Clause, it must be terminated by a comma, otherwise the trailing comma on the last Clauses is optional.

trait Clauselike

Intended as a common trait for Clauses and Unclaused Statements.

Intended as a common trait for Clauses and Unclaused Statements.

case class ClausesExpr(exprs: Arr[Expr]) extends ExprSeqNonEmpty
case class CommaToken(startPosn: TextPosn) extends EmptyExprToken with StatementMember
object CurlyBlock
case object CurlyBraces extends Braces
case class CurlyCloseToken(startPosn: TextPosn) extends BracketCloseToken
case class CurlyOpenToken(startPosn: TextPosn) extends BracketOpen

A raw natural number token.

A raw natural number token.

case class Dot2Token(startPosn: TextPosn) extends ClauseMemberToken

The double Dot or Stop Token.

The double Dot or Stop Token.

case class Dot3Token(startPosn: TextPosn) extends ClauseMemberToken

The triple Dot or Stop Token.

The triple Dot or Stop Token.

case class DotToken(startPosn: TextPosn) extends ClauseMemberToken

The Dot or Stop Token.

The Dot or Stop Token.

Empty Clause class, represented by just a comma.

Empty Clause class, represented by just a comma.

Companion
object
object EmptyClause

Factory object for the empty clause. Not sure if it is necessary

Factory object for the empty clause. Not sure if it is necessary

Companion
class

The Semicolon of the Empty statement is the expression of this special case of the unclaused statement

The Semicolon of the Empty statement is the expression of this special case of the unclaused statement

Companion
object
Companion
class
trait Expr extends BlockMember with ClauseMember

The fundamental expression trait. As it currently stands properly formed Statements either is empty or contains an expression or a sequence of clauses that contain each contain an expression.

The fundamental expression trait. As it currently stands properly formed Statements either is empty or contains an expression or a sequence of clauses that contain each contain an expression.

trait Expr0 extends Expr1
trait Expr1 extends Expr
trait ExprCompound extends Expr with TextSpanCompound

A compound expression. The traits sole purpose is to give an Expr, the start and end text positions from its first and last components.

A compound expression. The traits sole purpose is to give an Expr, the start and end text positions from its first and last components.

trait ExprSeq extends Expr

An ExprSeq can be a sequence of Statements or a Sequence of Clauses.

An ExprSeq can be a sequence of Statements or a Sequence of Clauses.

An ExprSeq can be a sequence of Statements or a Sequence of Clauses.

An ExprSeq can be a sequence of Statements or a Sequence of Clauses.

trait ExprToken extends Expr with ClauseMemberToken

A Token that is an Expression. Most tokens are expressions, but some are not such as braces, commas and semicolons.

A Token that is an Expression. Most tokens are expressions, but some are not such as braces, commas and semicolons.

case class FileStatements(statements: Arr[Statement]) extends BlockStatements
case class HashAlphaToken(startPosn: TextPosn, srcStr: String) extends ExprToken

The purpose of this token is for use at the beginning of a file, to make the the rest of the Statements, sub-statements. As if they were the statements inside parenthesis.

The purpose of this token is for use at the beginning of a file, to make the the rest of the Statements, sub-statements. As if they were the statements inside parenthesis.

An identifier Token that is also a valid raw hexadecimal raw Base32 token.

An identifier Token that is also a valid raw hexadecimal raw Base32 token.

case class IdentLowerBase32OnlyToken(startPosn: TextPosn, srcStr: String) extends IdentLowerToken with NatBase32Token

An identifier beginning with a lowercase that is not a valid raw Base32 or hexadecimal token.

An identifier beginning with a lowercase that is not a valid raw Base32 or hexadecimal token.

case class IdentLowerHexaToken(startPosn: TextPosn, srcStr: String) extends IdentLowerToken

An identifier beginning with a lowercase that is a valid raw hexadecimal and raw Base32 token.

An identifier beginning with a lowercase that is a valid raw hexadecimal and raw Base32 token.

case class IdentLowerOnlyToken(startPosn: TextPosn, srcStr: String) extends IdentLowerToken

An identifier beginning with a lowercase that is not a valid raw Base32 or hexadecimal token.

An identifier beginning with a lowercase that is not a valid raw Base32 or hexadecimal token.

A valid identifier beginning with a lowercase letter or an underscore character.

A valid identifier beginning with a lowercase letter or an underscore character.

Companion
object

Extractor function object for IdentLowerToken type.

Extractor function object for IdentLowerToken type.

Companion
class
case class IdentUnderToken(startPosn: TextPosn, srcStr: String) extends IdentifierToken

An identifier token beginning with an underscore character.

An identifier token beginning with an underscore character.

case class IdentUpperBase32OnlyToken(startPosn: TextPosn, srcStr: String) extends IdentUpperBase32Token

An alphanumeric token beginning with an alphabetic character that most commonly represents a name of something, but is also a valid raw Base32 Token.

An alphanumeric token beginning with an alphabetic character that most commonly represents a name of something, but is also a valid raw Base32 Token.

case class IdentUpperHexaToken(startPosn: TextPosn, srcStr: String) extends IdentUpperBase32Token with IdentHexaToken

An identifier beigning with an upper case letter that is also a valid raw hexadecimal token.

An identifier beigning with an upper case letter that is also a valid raw hexadecimal token.

case class IdentUpperOnlyToken(startPosn: TextPosn, srcStr: String) extends IdentUpperToken

An identifier beginning with a upper case that is not a valid raw Base32 or hexadecimal token.

An identifier beginning with a upper case that is not a valid raw Base32 or hexadecimal token.

An alphanumeric identifier token beginning with an upper case alphabetic character.

An alphanumeric identifier token beginning with an upper case alphabetic character.

Companion
object

Extractor function object for IdentUpperToken type.

Extractor function object for IdentUpperToken type.

Companion
class
trait IdentifierToken extends ExprToken

An alphanumeric token beginning with an alphabetic character that normally represents a name of something, that identifies something.

An alphanumeric token beginning with an alphabetic character that normally represents a name of something, that identifies something.

Companion
object
object IntDeciToken
Companion
class
case class IntNegToken(startPosn: TextPosn, digitsStr: String) extends IntDeciToken

Negative natural number token. There must be no space between the '-' character and the digits.

Negative natural number token. There must be no space between the '-' character and the digits.

An un-claused Statement that is not the empty statement.

An un-claused Statement that is not the empty statement.

case class Nat0tToken(startPosn: TextPosn, digitsStr: String) extends NatBase32Token

An unambiguous base32 natural number token, starts with the 0z characters.

An unambiguous base32 natural number token, starts with the 0z characters.

case class Nat0xToken(startPosn: TextPosn, digitsStr: String) extends NatHexaToken

A hexadecimal token with a leading "0x", that can be used for standard 32 bit Ints, 64 bit Longs, as well as less used integer formats such as BigInteger and Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

A hexadecimal token with a leading "0x", that can be used for standard 32 bit Ints, 64 bit Longs, as well as less used integer formats such as BigInteger and Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

Companion
object
object Nat0xToken

Function for parsing explicit Hexadecimal Token, one that begins with the charchters '0x'.

Function for parsing explicit Hexadecimal Token, one that begins with the charchters '0x'.

Companion
class
case class Nat0yToken(startPosn: TextPosn, digitsStr: String) extends NatToken

A hexadecimal token with a leading "0y", that can be used for standard 32 bit Ints, 64 bit Longs, as well as less used integer formats such as BigInteger and Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

A hexadecimal token with a leading "0y", that can be used for standard 32 bit Ints, 64 bit Longs, as well as less used integer formats such as BigInteger and Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

Companion
object
object Nat0yToken

Function for parsing explicit Hexadecimal Token, one that begins with the charchters '0y'.

Function for parsing explicit Hexadecimal Token, one that begins with the charchters '0y'.

Companion
class
case class Nat32OnlyToken(startPosn: TextPosn, srcStr: String) extends NatRawToken

A raw natural Base32 integer token starting with a digit that is not a valid hexadecimal or decimal number.

A raw natural Base32 integer token starting with a digit that is not a valid hexadecimal or decimal number.

trait NatBase32Token extends NatToken

Token for base 32 natural number. All DecimalTokens are also legal base32 tokens, as well as all raw hexadecimal tokens. Base32 , '0' .. '9', followed by 'A' .. 'W' with letter 'O' unused. Some Alpha numeric terms are valid TrigDualInts.

Token for base 32 natural number. All DecimalTokens are also legal base32 tokens, as well as all raw hexadecimal tokens. Base32 , '0' .. '9', followed by 'A' .. 'W' with letter 'O' unused. Some Alpha numeric terms are valid TrigDualInts.

case class NatDeciToken(startPosn: TextPosn, srcStr: String) extends NatHexaToken with IntDeciToken

A 64 bit natural number token in standard decimal format, but which can be inferred to be a raw Hexadecimal. It can be used for standard 32 bit Ints and 64 bit Longs, as well as less used integer formats such as Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

A 64 bit natural number token in standard decimal format, but which can be inferred to be a raw Hexadecimal. It can be used for standard 32 bit Ints and 64 bit Longs, as well as less used integer formats such as Byte. This is in accord with the principle that RSON at the Token and AST (Abstract Syntax Tree) levels stores data not code, although of course at the higher semantic levels it can be used very well for programming languages.

trait NatHexaToken extends NatToken

Common trait for all tokens that can be valid hexadecimal natural numbers.

Common trait for all tokens that can be valid hexadecimal natural numbers.

Companion
object
Companion
class

A raw valid natural number Token. All of these tokens are valid raw Base 32 tokens. A subset will be valid hexadecimal natural numbers and a subset of them will be valid decimal numbers.

A raw valid natural number Token. All of these tokens are valid raw Base 32 tokens. A subset will be valid hexadecimal natural numbers and a subset of them will be valid decimal numbers.

trait NatToken extends ExprToken

The base trait for all integer tokens. A Natural (non negative) number Token. It contains a single property, the digitStr. The digitStr depending on the class may be interpreted in 1 to 3 ways, as a normal decimal number, a hexadecimal number, or a trigdual (base 32) number.

The base trait for all integer tokens. A Natural (non negative) number Token. It contains a single property, the digitStr. The digitStr depending on the class may be interpreted in 1 to 3 ways, as a normal decimal number, a hexadecimal number, or a trigdual (base 32) number.

case class OperatorToken(startPosn: TextPosn, srcStr: String) extends ClauseMemberToken

An Operator token.

An Operator token.

object ParenthBlock
case class ParenthCloseToken(startPosn: TextPosn) extends BracketCloseToken
case class ParenthOpenToken(startPosn: TextPosn) extends BracketOpen
case object Parenthesis extends Braces
case class PreOpExpr(op: OperatorToken, right: Expr) extends ExprCompound
case class RawHexaToken(startPosn: TextPosn, srcStr: String) extends NatRawHexaToken

Raw hexadecimal natural number token, starting with a digit that includes one or more 'A' .. 'F' digits.

Raw hexadecimal natural number token, starting with a digit that includes one or more 'A' .. 'F' digits.

case class SemicolonToken(startPosn: TextPosn) extends EmptyExprToken
case class SpacedExpr(exprs: Arr[Expr]) extends ExprCompound
object SquareBlock
case object SquareBraces extends Braces
case class SquareCloseToken(startPosn: TextPosn) extends BracketCloseToken
case class SquareOpenToken(startPosn: TextPosn) extends BracketOpen
sealed trait Statement extends TextSpan

The top level compositional unit of Syntax in CRON: Compact Readable Object Notation. A statement can be claused consisting of comma separated clauses containing a single expression. An empty statement is a special case of the UnClausedStatement where the semicolon character is the expression.

The top level compositional unit of Syntax in CRON: Compact Readable Object Notation. A statement can be claused consisting of comma separated clauses containing a single expression. An empty statement is a special case of the UnClausedStatement where the semicolon character is the expression.

Companion
object
object Statement

Companion object for the Statement trait, contains implicit extension class for List[Statement].

Companion object for the Statement trait, contains implicit extension class for List[Statement].

Companion
class

A statement member is a Token except the semi colon, which is the statement delimiter and the braces, plus it includes blocks, As blocks contain a sequence of Statements but can themselves be part of a statement.

A statement member is a Token except the semi colon, which is the statement delimiter and the braces, plus it includes blocks, As blocks contain a sequence of Statements but can themselves be part of a statement.

case class StringStatements(statements: Arr[Statement]) extends BlockStatements
case class StringToken(startPosn: TextPosn, stringStr: String) extends ExprToken
trait Token extends TextSpan
Companion
object
object Token
Companion
class
sealed trait UnClausedStatement extends Statement

An unclaused Statement has a single expression.

An unclaused Statement has a single expression.

case class UnderscoreToken(startPosn: TextPosn) extends EmptyExprToken with StatementMember
case class UnimplementedExpr(bMems: Arr[BlockMember]) extends ExprCompound
object astParse

Function object for getting an EMon of Statements from Tokens.

Function object for getting an EMon of Statements from Tokens.

object bracesParse

Function object to sort tokens in to brace hierarchy.

Function object to sort tokens in to brace hierarchy.

I believe this composes Blocks with their preceding identifiers.

I believe this composes Blocks with their preceding identifiers.

object getExpr

Function object that seeks to get a valid expression from a Mono Statement or clause.

Function object that seeks to get a valid expression from a Mono Statement or clause.

Function object to parse identifier token. If successful it passes back, the remaining chars pointer, the test position and the token.

Function object to parse identifier token. If successful it passes back, the remaining chars pointer, the test position and the token.

Function object for parsing a raw natural integer number, could be a normal decimal, hexadecimal or trigdual number. Not all natural numbers are parsed with this function object. Raw hex and trigdual numbers can be encoded as alpha numeric identity tokens.

Function object for parsing a raw natural integer number, could be a normal decimal, hexadecimal or trigdual number. Not all natural numbers are parsed with this function object. Raw hex and trigdual numbers can be encoded as alpha numeric identity tokens.

Function object to parse operator token.

Function object to parse operator token.

Function object that parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first.

Function object that parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first.

object prefixPlus

Function object. Not entirely sure what this does.

Function object. Not entirely sure what this does.

object srcToETokens

Function object for creating an EMon of Refs of Token from a source. This internally uses a mutable ArrayBuffer, but the mutability is fully encapsulated.

Function object for creating an EMon of Refs of Token from a source. This internally uses a mutable ArrayBuffer, but the mutability is fully encapsulated.

Parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first. Function object to parse a raw Statement of statement members, where sub blocks have already been parsed into Statement Blocks.

Parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first. Function object to parse a raw Statement of statement members, where sub blocks have already been parsed into Statement Blocks.

Function object to parse a sequence of Statement members into a sequence of Statements. Statement members are either nonBracketTokens or parsed BracketBlocks. Parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first.

Function object to parse a sequence of Statement members into a sequence of Statements. Statement members are either nonBracketTokens or parsed BracketBlocks. Parses String (with RSON syntax) searching for the String terminator. Returns error if end of file found first.

Types

type Tokens = Arr[Token]

Value members

Concrete methods

def isOperator(char: Char): Boolean
def srcToEStatements(input: Array[Char], inputSourceName: String): ERefs[Statement]

Returns an EMon of a sequence of Statements from a file. This uses the fromString method. Non fatal exceptions or if the file doesn't exist will be returned as errors.

Returns an EMon of a sequence of Statements from a file. This uses the fromString method. Non fatal exceptions or if the file doesn't exist will be returned as errors.

def stringToStatements(input: String): ERefs[Statement]

Returns an EMon of a sequence of Statements from a String.

Returns an EMon of a sequence of Statements from a String.

def stringToTokens(srcStr: String): ERefs[Token]

Max numbers for long and hexidecimal formats needs to be implemented

Max numbers for long and hexidecimal formats needs to be implemented