Component Pascal


Component Pascal
Component Pascal
Paradigm(s) imperative, structured, modular, object-oriented
Appeared in 1991
Designed by Oberon Microsystems
Typing discipline strong, static
Influenced by Oberon-2

Component Pascal is a programming language in the tradition of Niklaus Wirth's Pascal, Modula-2, Oberon and Oberon-2. It bears the name of the Pascal programming language but is incompatible with it. Instead, it is a minor variant and refinement of Oberon-2, designed and supported by a small ETH Zürich spin-off company called Oberon microsystems. Their IDE (Integrated Development Environment) is called BlackBox Component Builder. At the time the first version was released (1994 as Oberon/F) it presented a novel approach to graphical user interface (GUI) construction based on editable forms, where fields and command buttons are linked to exported variables and executable procedures. This approach bears some similarity to the code-behind way used in Microsoft's .NET 3.0 to access code in XAML.

An Open Source implementation exists for the .NET and Java Virtual Machine platforms, from the Gardens Point team around John Gough at Queensland University of Technology in Australia.

On June 23, 2004 Oberon Microsystems announced that the BlackBox Component Builder was made available as a free download and that an open source version was planned. The beta open source version was initially released in December, 2004 and updated to a final v1.5 release in December, 2005. It includes the complete source code of the IDE, compiler, debugger, source analyser, profiler and interfacing libraries and can also be downloaded from their website. Several release candidates for v1.6 appeared in the years 2009 - 2011, the latest one (1.6rc6) appeared on Oberon Microsystems web pages in 2011.

BlackBox Component Pascal uses the extensions .odc (= Oberon document) for document files, such as source files for example, and .osf (= Oberon symbol file) for symbol files while Gardens Point Component Pascal uses .cp for source and .cps for symbol files. BlackBox Component Pascal has its own executable and loadable object format .ocf (= Oberon code file); it includes a runtime linking loader for this format.

Syntax

The full syntax for CP, as given by the Language Report, is shown below. Note that in the extended Backus–Naur form only 34 grammatical productions are required, just one more than for Oberon-2, although it is a rather more advanced language.

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 ["*" | "-"].

External links

Evolution of Oberon and Oberon-2


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Component Pascal — Paradigmen: imperativ, modular, objektorientiertert, komponentenorientiert Erscheinungsjahr: 1990 Entwickler: Niklaus Wirth / Oberon microsystems Aktuelle&# …   Deutsch Wikipedia

  • Component Pascal — …   Википедия

  • PASCAL — Paradigmen: imperativ, strukturiert Erscheinungsjahr: 1972 Entwickler: Niklaus Wirth Dialekte: UCSD Pascal …   Deutsch Wikipedia

  • Pascal (programming language) — Pascal Paradigm(s) imperative, structured Appeared in 1970 Designed by Niklaus Wirth Typing discipline static, strong, safe …   Wikipedia

  • Pascal (Programmiersprache) — Pascal Paradigmen: imperativ, strukturiert Erscheinungsjahr: 1972 Entwickler: Niklaus Wirth Typisierung: stark, statisch …   Deutsch Wikipedia

  • Component-based software engineering — A simple example of two components expressed in UML 2.0. The checkout component, responsible for facilitating the customer s order, requires the card processing component to charge the customer s credit/debit card (functionality that the latter… …   Wikipedia

  • Pascal (lenguaje de programación) — Para otros usos de este término, véase Pascal. Pascal Información general Paradigma imperativo (estructurado) Apareció en 1970 Diseñado po …   Wikipedia Español

  • Pascal Goldschmidt — Pascal J. Goldschmidt Clermont, M.D., is a Belgian born, American cardiologist, and is the Senior Vice President for Medical Affairs and the Dean of the Miller School of Medicine at the University of Miami. He was previously the Edward S. Orgain… …   Wikipedia

  • Component Library for Cross Platform — (CLX) (pronounced clicks), is a cross platform visual component based framework for developing Microsoft Windows and Linux applications. It is developed by Borland for use in its Kylix, Delphi, and C++ Builder software development environment.… …   Wikipedia

  • Pascal's law — noun pressure applied anywhere to a body of fluid causes a force to be transmitted equally in all directions; the force acts at right angles to any surface in contact with the fluid the hydraulic press is an application of Pascal s law • Syn:… …   Useful english dictionary