LanguageDef

case class LanguageDef(commentStart: String, commentEnd: String, commentLine: String, nestedComments: Boolean, identStart: Impl, identLetter: Impl, opStart: Impl, opLetter: Impl, keywords: Set[String], operators: Set[String], caseSensitive: Boolean, space: Impl)

This class is required to construct a TokenParser. It defines the various characteristics of the language to be tokenised. Where a parameter can be either a Set[Char] or a Parsley object, prefer the Set where possible. It will unlock a variety of faster intrinsic versions of the parsers, which will greatly improve tokenisation performance! In addition, the Sets are one time converted to heavily optimised BitSets, though that has up to 8KB memory usage associated but at least doubles the execution speed for that instruction. See parsley.Impl.

This class is required to construct a TokenParser. It defines the various characteristics of the language to be tokenised. Where a parameter can be either a Set[Char] or a Parsley object, prefer the Set where possible. It will unlock a variety of faster intrinsic versions of the parsers, which will greatly improve tokenisation performance! In addition, the Sets are one time converted to heavily optimised BitSets, though that has up to 8KB memory usage associated but at least doubles the execution speed for that instruction. See parsley.Impl.

Value Params
caseSensitive

Is the language case-sensitive. I.e. is IF equivalent to if?

commentEnd

For multi-line comments; how does the comment end? (If this or commentEnd is the empty string, multi-line comments are disabled)

commentLine

For single-line comments; how does the comment start? (This this is the empty string, single-line comments are disabled)

commentStart

For multi-line comments; how does the comment start? (If this or commentEnd is the empty string, multi-line comments are disabled)

identLetter

What characters can an identifier in the language consist of after the starting character?

identStart

What characters can an identifier in the language start with?

keywords

What keywords does the language contain?

nestedComments

Are multi-line comments allowed to be nested inside each other? E.g. If {- and -} are opening and closing comments, is the following valid syntax: {-{-hello -}-}? Note in C this is not the case.

opLetter

What characters can an operator in the language consist of after the starting character?

opStart

What characters can an operator in the language start with?

operators

What operators does the language contain?

space

What characters count as whitespace in the language?

Since

2.2.0

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product