SkyLine
  • SkyLine | Introduction
    • Module Overview
    • SkyLine's Development
    • Skyline's Reason
    • SkyLine Syntax
    • SkyLine Concepts
      • Concepts | Modes
  • SkyLine | Technologies
    • Module Overview
    • REPL
      • REPL - Basic usage
      • REPL - Console Design
      • REPL - Commands
    • SLC
      • SLC - What is it
      • SLC - Use cases
      • SLC - Lexical Analysis
      • SLC - Intro To Development
      • SLC - Error System
  • SkyLine | Theory
    • Module Overview
    • Theory | Type Systems
      • Objects | Strings
      • Objects | Integers & Floats
  • SkyLine | Development
    • Module Overview
    • Development | Hello Integers?
  • SL | Hybrid Development
    • Module Overview
    • Hybrid Projects | Advancing
    • Hybrid Projects | Wrapping
    • Hybrid Projects | Using SLC
  • SkyLine | For Abusers
    • SL Abuser | Security Research
    • SL Abuser | Module Overview
    • SL Abuser | Abusing Helps
  • SkyLine Experiments
    • Introduction To Module
      • Caster - IoT Manipulation With SkyLine
        • Caster In Real World Scenarios
          • Cracking The Grounds
        • Caster: Setting Up
        • Caster - Running Caster
        • Caster - Dev Manipulation
          • Caster - Console
          • Caster - Apple Devs
          • Caster - Amazon Devs
          • Caster - Google Devs
          • Caster - Roku Devs
      • SkyNeXt - Hacking The Skies
      • SkyLine - PwnLib
Powered by GitBook
On this page
  1. SkyLine | Technologies
  2. SLC

SLC - Lexical Analysis

PreviousSLC - Use casesNextSLC - Intro To Development

Last updated 1 year ago

SLC | Lexical Analysis

Like any programming language or most anyway, SkyLine's configuration language (SLC) has a lexer or scanner. This scanner is not like any normal scanner and instead of comparing byte positions, characters, peeking specific string tokens, it rather relies on a regular expression set to tokenize and catgeorize information. This is something good to mention as SkyLine also has a regular expression scanner behind it but it does not make it a primary option. Within SLC, regex is used because the goal of SLC is to be the most powerful engine for project development but also become the most lightweight engine out there that has 0 forms of bloat. To do so, everything was compacted down into a map of regular expressions which is shown in the block below.

var ScannerTokenizationRegularExpressions = map[*regexp.Regexp]TokenDataType{
	regexp.MustCompile(`^=$`):  ASSIGN_Token,
	regexp.MustCompile(`^;$`):  SEMICOLON_Token,
	regexp.MustCompile(`^\($`): LPAREN_Token,
	regexp.MustCompile(`^\)$`): RPAREN_Token,
	regexp.MustCompile(`^,$`):  COMMA_Token,
	regexp.MustCompile(`^{`):   LBRACE_Token,
	regexp.MustCompile(`^}`):   RBRACE_Token,
	regexp.MustCompile(`^\[$`): LBRACKET_Token,
	regexp.MustCompile(`^\]$`): RBRACKET_Token,
}
Page cover image