Component Pascal
linguaggio di programmazione
Data di origine1997
Paradigmiprogrammazione imperativa, programmazione strutturata, programmazione modulare e programmazione orientata agli oggetti
Influenzato daOberon-2
Implementazione di riferimento
Sito webwww.oberon.ch/

Il Component Pascal è un linguaggio di programmazione che segue la tradizione dei linguaggi sviluppati da Niklaus Wirth (Pascal, Modula-2, Oberon and Oberon-2). Sebbene porti il nome del linguaggio di programmazione Pascal, è incompatibile con esso ed è invece una variante minore e un raffinamento di Oberon-2. Component Pascal è stato progettato da una piccola spin off dell'ETH Zürich chiamata Oberon microsystems.

Esiste un'implementazione open source del linguaggio per le piattaforme .NET e Java Virtual Machine, fornita dal team Gardens Point guidato da John Gough presso la Queensland University of Technology in Australia.

Sintassi

modifica

La sintassi completa per il linguaggio Component Pascal è mostrata sotto. Essa consiste in 34 produzioni in forma Backus-Naur estesa, solo una in più del linguaggio Oberon-2, sebbene Component Pascal sia notevolmente più avanzato.

Module = MODULE ident ";" 
           [ImportList] DeclSeq 
           [BEGIN StatementSeq] 
           [CLOSE StatementSeq] 
         END ident ".".

ImportList = IMPORT [ident ":="] ident {"," [ident ":="] ident} ";".

DeclSeq = { CONST {ConstDecl ";" } 
          | TYPE {TypeDecl ";"} 
          | VAR {VarDecl ";"}} 
          { ProcDecl ";" | ForwardDecl ";"}.

ConstDecl = IdentDef "=" ConstExpr.

TypeDecl = IdentDef "=" Type.

VarDecl = IdentList ":" Type.

ProcDecl = PROCEDURE [Receiver] IdentDef [FormalPars] MethAttributes 
           [";" DeclSeq [BEGIN StatementSeq] 
           END ident].

MethAttributes = ["," NEW] ["," (ABSTRACT | EMPTY | EXTENSIBLE)].

ForwardDecl = PROCEDURE "^" [Receiver] IdentDef [FormalPars] MethAttributes.

FormalPars = "(" [FPSection {";" FPSection}] ")" [":" Type].

FPSection = [VAR | IN | OUT] ident {"," ident} ":" Type.

Receiver = "(" [VAR | IN] ident ":" ident ")".

Type = Qualident
    | ARRAY [ConstExpr {"," ConstExpr}] OF Type
    | [ABSTRACT | EXTENSIBLE | LIMITED] RECORD ["("Qualident")"] FieldList {";" FieldList} END
    | POINTER TO Type
    | PROCEDURE [FormalPars].

FieldList = [IdentList ":" Type].

StatementSeq = Statement {";" Statement}.

Statement = [ Designator ":=" Expr
    | Designator ["(" [ExprList] ")"]
    | IF Expr THEN StatementSeq
        {ELSIF Expr THEN StatementSeq}
        [ELSE StatementSeq] 
      END
    | CASE Expr OF 
        Case {"|" Case}
        [ELSE StatementSeq] 
      END
    | WHILE Expr DO StatementSeq END
    | REPEAT StatementSeq UNTIL Expr
    | FOR ident ":=" Expr TO Expr [BY ConstExpr] DO StatementSeq END
    | LOOP StatementSeq END
    | WITH [ Guard DO StatementSeq ] 
       {"|" [ Guard DO StatementSeq ] } 
       [ELSE StatementSeq] 
      END
    | EXIT
    | RETURN [Expr]
    ].

Case = [CaseLabels {"," CaseLabels} ":" StatementSeq].

CaseLabels = ConstExpr [".." ConstExpr].

Guard = Qualident ":" Qualident.

ConstExpr = Expr.

Expr = SimpleExpr [Relation SimpleExpr].

SimpleExpr = ["+" | "-"] Term {AddOp Term}.

Term = Factor {MulOp Factor}.

Factor = Designator | number | character | string | NIL | Set | "(" Expr ")" | " ~ " Factor.

Set = "{" [Element {"," Element}] "}".

Element = Expr [".." Expr].

Relation = "=" | "#" | "<" | "<=" | ">" | ">=" | IN | IS.

AddOp = "+" | "-" | OR.

MulOp = "*" | "/" | DIV | MOD | "&".

Designator = Qualident {"." ident 
             | "[" ExprList "]" 
             | "^" 
             | "(" Qualident ")" 
             | "(" [ExprList] ")"} [ "$" ].

ExprList = Expr {"," Expr}.

IdentList = IdentDef {"," IdentDef}.

Qualident = [ident "."] ident.

IdentDef = ident ["*" | "-"].

Collegamenti esterni

modifica
  Portale Informatica: accedi alle voci di Wikipedia che trattano di informatica

📚 Artikel Terkait di Wikipedia

Hash table

Ciò può essere fatto, ad esempio, ridimensionando l'array ogni volta che si supera il load factor desiderato. Di seguito vengono riportati i metodi più

Icariina

flavonoids in Epimedium by capillary zone electrophoresis coupled with diode array detection using central composite design, J Chromatogr A volume 1103-2 pp

Telit

Telit ha introdotto il modulo con ball-grid-array (BGA), i concetti di "Family" e "Unified-Form-Factor" (moduli differenti con differenti tecnologie

Periostina

suggerimenti del progetto di riferimento. La periostina o osteoblast specific factor o POSTN è una proteina che nell'uomo è codificata dal gene POSTN. La sua

Antenna a spirale

1049/ip-map:20050045. ^ Asad, M., Gilani, J., Khalid, A. e Iqbal, M.S., Optimizing the Q factor of a square spiral antenna, in PACCS, 2010, pp. 227-230. ^ Stephen E. Lipsky

CRISPR

su giornali scientifici maggiori (con elevato indice citazionale Impact Factor), ma apparvero in altre riviste minori. La prima ricerca che ipotizzò un

Sistema embedded

metodo di progetto prevede l'utilizzo di FPGA (Field-Programmable Gate Array), con la programmazione di tutta la logica interna, inclusa la CPU. La maggior

Rivelatore di onde gravitazionali

approccio per rilevare le onde gravitazionali è usato dal Parkes Pulsar Timing Array. Questo progetto si propone di rilevare le onde gravitazionali cercando