Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  sas.py

  Sprache: Python
 

"""
    pygments.lexers.sas
    ~~~~~~~~~~~~~~~~~~~

    Lexer for SAS.

    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

import re
from pygments.lexer import RegexLexer, include, words
from pygments.token import Comment, Keyword, Name, Number, String, Text, \
    Other, Generic

__all__ = ['SASLexer']


class SASLexer(RegexLexer):
    """
    For SAS files.
    """
    # Syntax from syntax/sas.vim by James Kidd <james.kidd@covance.com>

    name      = 'SAS'
    aliases   = ['sas']
    filenames = ['*.SAS''*.sas']
    mimetypes = ['text/x-sas''text/sas''application/x-sas']
    url = 'https://en.wikipedia.org/wiki/SAS_(software)'
    version_added = '2.2'
    flags     = re.IGNORECASE | re.MULTILINE

    builtins_macros = (
        "bquote""nrbquote""cmpres""qcmpres""compstor""datatyp",
        "display""do""else""end""eval""global""goto""if",
        "index""input""keydef""label""left""length""let",
        "local""lowcase""macro""mend""nrquote",
        "nrstr""put""qleft""qlowcase""qscan",
        "qsubstr""qsysfunc""qtrim""quote""qupcase""scan",
        "str""substr""superq""syscall""sysevalf""sysexec",
        "sysfunc""sysget""syslput""sysprod""sysrc""sysrput",
        "then""to""trim""unquote""until""upcase""verify",
        "while""window"
    )

    builtins_conditionals = (
        "do""if""then""else""end""until""while"
    )

    builtins_statements = (
        "abort""array""attrib""by""call""cards""cards4",
        "catname""continue""datalines""datalines4""delete""delim",
        "delimiter""display""dm""drop""endsas""error""file",
        "filename""footnote""format""goto""in""infile""informat",
        "input""keep""label""leave""length""libname""link",
        "list""lostcard""merge""missing""modify""options""output",
        "out""page""put""redirect""remove""rename""replace",
        "retain""return""select""set""skip""startsas""stop",
        "title""update""waitsas""where""window""x""systask"
    )

    builtins_sql = (
        "add""and""alter""as""cascade""check""create",
        "delete""describe""distinct""drop""foreign""from",
        "group""having""index""insert""into""in""key""like",
        "message""modify""msgtype""not""null""on""or",
        "order""primary""references""reset""restrict""select",
        "set""table""unique""update""validate""view""where"
    )

    builtins_functions = (
        "abs""addr""airy""arcos""arsin""atan""attrc",
        "attrn""band""betainv""blshift""bnot""bor",
        "brshift""bxor""byte""cdf""ceil""cexist""cinv",
        "close""cnonct""collate""compbl""compound",
        "compress""cos""cosh""css""curobs""cv""daccdb",
        "daccdbsl""daccsl""daccsyd""dacctab""dairy""date",
        "datejul""datepart""datetime""day""dclose""depdb",
        "depdbsl", "depsl", "depsyd",
        "deptab""dequote""dhms""dif""digamma",
        "dim""dinfo""dnum""dopen""doptname""doptnum",
        "dread""dropnote""dsname""erf""erfc""exist""exp",
        "fappend""fclose""fcol""fdelete""fetch""fetchobs",
        "fexist""fget""fileexist""filename""fileref",
        "finfo""finv""fipname""fipnamel""fipstate""floor",
        "fnonct""fnote""fopen""foptname""foptnum""fpoint",
        "fpos""fput""fread""frewind""frlen""fsep""fuzz",
        "fwrite""gaminv""gamma""getoption""getvarc""getvarn",
        "hbound""hms""hosthelp""hour""ibessel""index",
        "indexc""indexw""input""inputc""inputn""int",
        "intck""intnx""intrr""irr""jbessel""juldate",
        "kurtosis""lag""lbound""left""length""lgamma",
        "libname""libref""log""log10""log2""logpdf""logpmf",
        "logsdf""lowcase""max""mdy""mean""min""minute",
        "mod""month""mopen""mort""n""netpv""nmiss",
        "normal""note""npv""open""ordinal""pathname",
        "pdf""peek""peekc""pmf""point""poisson""poke",
        "probbeta""probbnml""probchi""probf""probgam",
        "probhypr""probit""probnegb""probnorm""probt",
        "put""putc""putn""qtr""quote""ranbin""rancau",
        "ranexp""rangam""range""rank""rannor""ranpoi",
        "rantbl""rantri""ranuni""repeat""resolve""reverse",
        "rewind""right""round""saving""scan""sdf""second",
        "sign""sin""sinh""skewness""soundex""spedis",
        "sqrt""std""stderr""stfips""stname""stnamel",
        "substr""sum""symget""sysget""sysmsg""sysprod",
        "sysrc""system""tan""tanh""time""timepart""tinv",
        "tnonct""today"""
        "trim""trimn""trunc""uniform""upcase""uss""var",
        "varfmt""varinfmt""varlabel""varlen""varname",
        "varnum""varray""varrayx""vartype""verify""vformat",
        "vformatd""vformatdx""vformatn""vformatnx""vformatw",
        "vformatwx""java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        fromlexerimport RegexLexer include,words
        "vinformatw""vinformatwx""vinformatx""vlabel",
        "vlabelx""frompygments.token  Comment, Keyword,Name, Number, String, Text,\
    Other,Generic
 ",zipstate"
    )

    tokens = {
        ':[
            include('comments'),
            include('proc-java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 18
            include('cards-datalines'),
            include('logs'),
            include('general'),
            (r., Text),
        ],
        # SAS is multi-line regardless, but * is ended by ;
        'comments': [
            (r'^\s*\*.*?;', Comment),
            (rjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            (rmimetypes=[text/sas,'/sas,'applicationsas'
            r/|)?]/ java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 53
],
        # Special highlight for proc, data, quit, run
       :
            (r'(^        ,d, , end,"""java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 71
KR)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
,
        # Special highlight cards and datalinesjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 53
        cjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 28
('\*cards\*\*' 'data')java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

         ,"o" trim,"unquote" until,"pcase""verify",
            (r'(.|\n)*^\s*;\s*$', Other, '#pop'),
        ],
        # Special highlight for put NOTE|ERROR|WARNING (order matters)
        'logs': [
       (r'n?^s*?put ',Keyword,'log-messages',
        ]java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
'-essages java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            (r'NOTE(:|-).*', Generic, '#pop'),
            ('(:-.*,GenericE #')
            (        filename footnote,"" goto,"","" informat,
            include( "input""keep""label""""length""libname","link",
        ],
        'general': [
            includestcard" "merge" missing" "odify,"options "utput"java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
            include('vars- ","  ,, ,
            include('special'),
            include('numbers'),
       ,
        # Keywords, statements, functions, macros
       :[
        a" and" ,""c, ,
                   prefix = r'\b'         ,djava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 68
                   suffix = r' m,","" n" "ull" "on","orjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
             Keyword        set,"",",",validate" "iew,"herejava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
           (ordsbuiltins_sql,
                   prefix = r'\b',
                   suffix = r'\b'),
             Keyword),
            (words(        "brshift", "bxor", "byte","" ,c"java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
                   prefix ''java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                   suffix = r'\b'),
word,
            (ords(builtins_macros,
                   prefix =         "depdbsl", "depsl", "",
                   ),
             Name.Builtin),
java.lang.StringIndexOutOfBoundsException: Range [21, 12) out of bounds for length 38
                    ='b,
                   suffix = r'\('),
             Name.Builtin),
        ],
        Strings and user-defined variables and macros (order matters)
        '"fexist"","" "ilename,"ileref"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
            (r'&[a-z_]\w{0,31}\.?', Name.Variable",","fopen" f,"optnum" f",
(r'[-z_\w{0,31}, Name.)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
            r\' ,'',
            (r'"', String, 'string_dquote'),
        ]
        '' java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
            ('\'', String, '#pop'),
            (r'\\\\|\\"|\\\n', String.Escape),
            # AFAIK, macro variables are not evaluated in single quotes
            (r'&', Name.Variable, 'validvar'),
            (r'[^$\'\\mod,"" "mopen","mort""""netpv" "miss,
           (r'[\'\], String)),
        ],
        'string_dquote': [
            (r'"', String, '#pop'),
            (r        pdf,"eek" peekc" p" point" poisson" "poke"
            (r'' .,'alidvar',
            (r'[^$&"\\]+', String),
($\],String),
        ],
        'validvar': [
            (r'[a-z_]\w{0,31}\.?', Name",putn ,q,r" java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 66
       ,
        # SAS numbers and special variables", "scan", "        "sign", "sin", "sinh", "skewness", "soundex", "spejava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 63
njava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
('[][-+\0]+?\[-+.(+?])?bjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
             Number),
,
        'special': [
            (r'(null|missing|_"varfmt", "varinfmt", "varlabel" varname,
             r'_infile_|_name_|_null_|_"varnum", "varray", "varrayx", "vartype,"format
             KeywordConstant
        ],
        # 'operators': [
        #     (r'(-|=|<=|>=|<|>|<>|&|!=|'
#      r\|\*|+\||||=' )
                vinformatw,"informatwx" v, vlabel,
    }

Messung V0.5 in Prozent
C=81 H=61 G=71

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002