Goal -> (Program | Package | Library | Unit)
Program -> [PROGRAM Ident ['(' IdentList ')'] ';'] ProgramBlock '.'Unit -> UNIT Ident ';' InterfaceSection
ImplementationSection
InitSection '.'Package -> PACKAGE Ident ';' [RequiresClause]
[ContainsClause]
END '.'Library -> LIBRARY Ident ';' ProgramBlock '.'ProgramBlock -> [UsesClause] BlockUsesClause -> USES IdentList ';'
InterfaceSection -> INTERFACE [UsesClause]
[InterfaceDecl]...InterfaceDecl -> ConstSection -> TypeSection
-> VarSection
-> ExportedHeadingExportedHeading -> ProcedureHeading ';' [Directive] -> FunctionHeading ';' [Directive]ImplementationSection -> IMPLEMENTATION [UsesClause]
[DeclSection]...Block -> [DeclSection] CompoundStmtDeclSection -> LabelDeclSection -> ConstSection
-> TypeSection
-> VarSection
-> ProcedureDeclSectionLabelDeclSection -> LABEL LabelId
ConstSection -> CONST (ConstantDecl ';')...
ConstantDecl -> Ident '=' ConstExpr -> Ident ':' TypeId '=' TypedConstantTypeSection -> TYPE (TypeDecl ';')...
TypeDecl -> Ident '=' Type -> Ident '=' RestrictedTypeTypedConstant -> (ConstExpr | ArrayConstant | RecordConstant)
ArrayConstant -> '(' TypedConstant/','... ')'
RecordConstant -> '(' RecordFieldConstant/';'... ')'
RecordFieldConstant -> Ident ':' TypedConstant
Type -> TypeId -> SimpleType
-> StrucType
-> PointerType
-> StringType
-> ProcedureType
-> VariantType
-> ClassRefTypeRestrictedType -> ObjectType -> ClassType
-> InterfaceTypeClassRefType -> CLASS OF TypeId
SimpleType -> (OrdinalType | RealType)
RealType -> REAL48 -> REAL
-> SINGLE
-> DOUBLE
-> EXTENDED
-> CURRENCY
-> COMPOrdinalType -> (SubrangeType | EnumeratedType | OrdIdent)
OrdIdent -> SHORTINT -> SMALLINT
-> INTEGER
-> BYTE
-> LONGINT
-> INT64
-> WORD
-> BOOLEAN
-> CHAR
-> WIDECHAR
-> LONGWORD
-> PCHARVariantType -> VARIANT -> OLEVARIANTSubrangeType -> ConstExpr '..' ConstExpr
EnumeratedType -> '(' EnumeratedTypeElement/','... ')'
EnumeratedTypeElement -> Ident [ '=' ConstExpr ]
StringType -> STRING -> ANSISTRING
-> WIDESTRING
-> STRING '[' ConstExpr ']'StrucType -> [PACKED] (ArrayType | SetType | FileType | RecType)
ArrayType -> ARRAY ['[' OrdinalType/','... ']'] OF Type
RecType -> RECORD [FieldList] END
FieldList -> FieldDecl/';'... [VariantSection] [';']
FieldDecl -> IdentList ':' Type
VariantSection -> CASE [Ident ':'] TypeId OF RecVariant/';'...
RecVariant -> ConstExpr/','... ':' '(' [FieldList] ')'
SetType -> SET OF OrdinalType
FileType -> FILE OF TypeIdPointerType -> '^' TypeId
ProcedureType -> (ProcedureHeading | FunctionHeading) [OF OBJECT]
VarSection -> VAR (VarDecl ';')...
VarDecl -> IdentList ':' Type [(ABSOLUTE (Ident | ConstExpr)) | '=' ConstExpr]
Expression -> SimpleExpression [RelOp SimpleExpression]...
SimpleExpression -> ['+' | '-'] Term [AddOp Term]...
Term -> Factor [MulOp Factor]...
Factor -> Designator ['(' ExprList ')'] -> '@' Designator
-> Number
-> String
-> NIL
-> '(' Expression ')'
-> NOT Factor
-> SetConstructor
-> TypeId '(' Expression ')'RelOp -> '>' -> '<'
-> '<='
-> '>='
-> '<>'
-> IN
-> IS
-> ASAddOp -> '+' -> '-'
-> OR
-> XORMulOp -> '*' -> '/'
-> DIV
-> MOD
-> AND
-> SHL
-> SHRDesignator -> QualId ['.' Ident | '[' ExprList ']' | '^']...
SetConstructor -> '[' [SetElement/','...] ']'
SetElement -> Expression ['..' Expression]
ExprList -> Expression/','...
Statement -> [LabelId ':'] [SimpleStatement | StructStmt]
StmtList -> Statement/';'...
SimpleStatement -> Designator ['(' ExprList ')'] -> Designator ':=' Expression
-> INHERITED
-> GOTO LabelIdStructStmt -> CompoundStmt -> ConditionalStmt
-> LoopStmt
-> WithStmtCompoundStmt -> BEGIN StmtList END
ConditionalStmt -> IfStmt -> CaseStmtIfStmt -> IF Expression THEN Statement [ELSE Statement]
CaseStmt -> CASE Expression OF CaseSelector/';'... [ELSE StmtList] [';'] END
CaseSelector -> CaseLabel/','... ':' Statement
CaseLabel -> ConstExpr ['..' ConstExpr]
LoopStmt -> RepeatStmt -> WhileStmt
-> ForStmtRepeatStmt -> REPEAT Statement UNTIL Expression
WhileStmt -> WHILE Expression DO Statement
ForStmt -> FOR QualId ':=' Expression (TO | DOWNTO) Expression DO Statement
WithStmt -> WITH IdentList DO Statement
ProcedureDeclSection -> ProcedureDecl -> FunctionDeclProcedureDecl -> ProcedureHeading ';' [Directive] Block ';'FunctionDecl -> FunctionHeading ';' [Directive] Block ';'FunctionHeading -> FUNCTION Ident [FormalParameters] ':' (SimpleType | STRING)
ProcedureHeading -> PROCEDURE Ident [FormalParameters]
FormalParameters -> '(' FormalParm/';'... ')'
FormalParm -> [VAR | CONST | OUT] Parameter
Parameter -> IdentList [':' ([ARRAY OF] SimpleType | STRING | FILE)] -> Ident ':' SimpleType '=' ConstExprDirective -> CDECL -> REGISTER
-> DYNAMIC
-> VIRTUAL
-> EXPORT
-> EXTERNAL
-> FAR
-> FORWARD
-> MESSAGE
-> OVERRIDE
-> OVERLOAD
-> PASCAL
-> REINTRODUCE
-> SAFECALL
-> STDCALLObjectType -> OBJECT [ObjHeritage] [ObjFieldList] [MethodList] END
ObjHeritage -> '(' QualId ')'
MethodList -> (MethodHeading [';' VIRTUAL])/';'...
MethodHeading -> ProcedureHeading -> FunctionHeading
-> ConstructorHeading
-> DestructorHeadingConstructorHeading -> CONSTRUCTOR Ident [FormalParameters]
DestructorHeading -> DESTRUCTOR Ident [FormalParameters]
ObjFieldList -> (IdentList ':' Type)/';'...
InitSection -> INITIALIZATION StmtList [FINALIZATION StmtList] END -> BEGIN StmtList END
-> ENDClassType -> CLASS [ClassHeritage] [ClassFieldList]
[ClassMethodList]
[ClassPropertyList]
ENDClassHeritage -> '(' IdentList ')'
ClassVisibility -> [PUBLIC | PROTECTED | PRIVATE | PUBLISHED]
ClassFieldList -> (ClassVisibility ObjFieldList)/';'...
ClassMethodList -> (ClassVisibility MethodList)/';'...
ClassPropertyList -> (ClassVisibility PropertyList ';')...
PropertyList -> PROPERTY Ident [PropertyInterface] PropertySpecifiers
PropertyInterface -> [PropertyParameterList] ':' Ident
PropertyParameterList -> '[' (IdentList ':' TypeId)/';'... ']'PropertySpecifiers -> [INDEX ConstExpr] [READ Ident]
[WRITE Ident]
[STORED (Ident | Constant)]
[(DEFAULT ConstExpr) | NODEFAULT]
[IMPLEMENTS TypeId]InterfaceType -> INTERFACE [InterfaceHeritage] [ClassMethodList]
[ClassPropertyList]
ENDInterfaceHeritage -> '(' IdentList ')'
RequiresClause -> REQUIRES IdentList... ';'
ContainsClause -> CONTAINS IdentList... ';'
IdentList -> Ident/','...
QualId -> [UnitId '.'] Ident
TypeId -> [UnitId '.'] <type-identifier>
Ident -> <identifier>
ConstExpr -> <constant-expression>
UnitId -> <unit-identifier>
LabelId -> <label-identifier>
Number -> <number>
String -> <string>
Program -> [PROGRAM Ident ['(' IdentList ')'] ';'] ProgramBlock '.'Unit -> UNIT Ident ';' InterfaceSection
ImplementationSection
InitSection '.'Package -> PACKAGE Ident ';' [RequiresClause]
[ContainsClause]
END '.'Library -> LIBRARY Ident ';' ProgramBlock '.'ProgramBlock -> [UsesClause] BlockUsesClause -> USES IdentList ';'
InterfaceSection -> INTERFACE [UsesClause]
[InterfaceDecl]...InterfaceDecl -> ConstSection -> TypeSection
-> VarSection
-> ExportedHeadingExportedHeading -> ProcedureHeading ';' [Directive] -> FunctionHeading ';' [Directive]ImplementationSection -> IMPLEMENTATION [UsesClause]
[DeclSection]...Block -> [DeclSection] CompoundStmtDeclSection -> LabelDeclSection -> ConstSection
-> TypeSection
-> VarSection
-> ProcedureDeclSectionLabelDeclSection -> LABEL LabelId
ConstSection -> CONST (ConstantDecl ';')...
ConstantDecl -> Ident '=' ConstExpr -> Ident ':' TypeId '=' TypedConstantTypeSection -> TYPE (TypeDecl ';')...
TypeDecl -> Ident '=' Type -> Ident '=' RestrictedTypeTypedConstant -> (ConstExpr | ArrayConstant | RecordConstant)
ArrayConstant -> '(' TypedConstant/','... ')'
RecordConstant -> '(' RecordFieldConstant/';'... ')'
RecordFieldConstant -> Ident ':' TypedConstant
Type -> TypeId -> SimpleType
-> StrucType
-> PointerType
-> StringType
-> ProcedureType
-> VariantType
-> ClassRefTypeRestrictedType -> ObjectType -> ClassType
-> InterfaceTypeClassRefType -> CLASS OF TypeId
SimpleType -> (OrdinalType | RealType)
RealType -> REAL48 -> REAL
-> SINGLE
-> DOUBLE
-> EXTENDED
-> CURRENCY
-> COMPOrdinalType -> (SubrangeType | EnumeratedType | OrdIdent)
OrdIdent -> SHORTINT -> SMALLINT
-> INTEGER
-> BYTE
-> LONGINT
-> INT64
-> WORD
-> BOOLEAN
-> CHAR
-> WIDECHAR
-> LONGWORD
-> PCHARVariantType -> VARIANT -> OLEVARIANTSubrangeType -> ConstExpr '..' ConstExpr
EnumeratedType -> '(' EnumeratedTypeElement/','... ')'
EnumeratedTypeElement -> Ident [ '=' ConstExpr ]
StringType -> STRING -> ANSISTRING
-> WIDESTRING
-> STRING '[' ConstExpr ']'StrucType -> [PACKED] (ArrayType | SetType | FileType | RecType)
ArrayType -> ARRAY ['[' OrdinalType/','... ']'] OF Type
RecType -> RECORD [FieldList] END
FieldList -> FieldDecl/';'... [VariantSection] [';']
FieldDecl -> IdentList ':' Type
VariantSection -> CASE [Ident ':'] TypeId OF RecVariant/';'...
RecVariant -> ConstExpr/','... ':' '(' [FieldList] ')'
SetType -> SET OF OrdinalType
FileType -> FILE OF TypeIdPointerType -> '^' TypeId
ProcedureType -> (ProcedureHeading | FunctionHeading) [OF OBJECT]
VarSection -> VAR (VarDecl ';')...
VarDecl -> IdentList ':' Type [(ABSOLUTE (Ident | ConstExpr)) | '=' ConstExpr]
Expression -> SimpleExpression [RelOp SimpleExpression]...
SimpleExpression -> ['+' | '-'] Term [AddOp Term]...
Term -> Factor [MulOp Factor]...
Factor -> Designator ['(' ExprList ')'] -> '@' Designator
-> Number
-> String
-> NIL
-> '(' Expression ')'
-> NOT Factor
-> SetConstructor
-> TypeId '(' Expression ')'RelOp -> '>' -> '<'
-> '<='
-> '>='
-> '<>'
-> IN
-> IS
-> ASAddOp -> '+' -> '-'
-> OR
-> XORMulOp -> '*' -> '/'
-> DIV
-> MOD
-> AND
-> SHL
-> SHRDesignator -> QualId ['.' Ident | '[' ExprList ']' | '^']...
SetConstructor -> '[' [SetElement/','...] ']'
SetElement -> Expression ['..' Expression]
ExprList -> Expression/','...
Statement -> [LabelId ':'] [SimpleStatement | StructStmt]
StmtList -> Statement/';'...
SimpleStatement -> Designator ['(' ExprList ')'] -> Designator ':=' Expression
-> INHERITED
-> GOTO LabelIdStructStmt -> CompoundStmt -> ConditionalStmt
-> LoopStmt
-> WithStmtCompoundStmt -> BEGIN StmtList END
ConditionalStmt -> IfStmt -> CaseStmtIfStmt -> IF Expression THEN Statement [ELSE Statement]
CaseStmt -> CASE Expression OF CaseSelector/';'... [ELSE StmtList] [';'] END
CaseSelector -> CaseLabel/','... ':' Statement
CaseLabel -> ConstExpr ['..' ConstExpr]
LoopStmt -> RepeatStmt -> WhileStmt
-> ForStmtRepeatStmt -> REPEAT Statement UNTIL Expression
WhileStmt -> WHILE Expression DO Statement
ForStmt -> FOR QualId ':=' Expression (TO | DOWNTO) Expression DO Statement
WithStmt -> WITH IdentList DO Statement
ProcedureDeclSection -> ProcedureDecl -> FunctionDeclProcedureDecl -> ProcedureHeading ';' [Directive] Block ';'FunctionDecl -> FunctionHeading ';' [Directive] Block ';'FunctionHeading -> FUNCTION Ident [FormalParameters] ':' (SimpleType | STRING)
ProcedureHeading -> PROCEDURE Ident [FormalParameters]
FormalParameters -> '(' FormalParm/';'... ')'
FormalParm -> [VAR | CONST | OUT] Parameter
Parameter -> IdentList [':' ([ARRAY OF] SimpleType | STRING | FILE)] -> Ident ':' SimpleType '=' ConstExprDirective -> CDECL -> REGISTER
-> DYNAMIC
-> VIRTUAL
-> EXPORT
-> EXTERNAL
-> FAR
-> FORWARD
-> MESSAGE
-> OVERRIDE
-> OVERLOAD
-> PASCAL
-> REINTRODUCE
-> SAFECALL
-> STDCALLObjectType -> OBJECT [ObjHeritage] [ObjFieldList] [MethodList] END
ObjHeritage -> '(' QualId ')'
MethodList -> (MethodHeading [';' VIRTUAL])/';'...
MethodHeading -> ProcedureHeading -> FunctionHeading
-> ConstructorHeading
-> DestructorHeadingConstructorHeading -> CONSTRUCTOR Ident [FormalParameters]
DestructorHeading -> DESTRUCTOR Ident [FormalParameters]
ObjFieldList -> (IdentList ':' Type)/';'...
InitSection -> INITIALIZATION StmtList [FINALIZATION StmtList] END -> BEGIN StmtList END
-> ENDClassType -> CLASS [ClassHeritage] [ClassFieldList]
[ClassMethodList]
[ClassPropertyList]
ENDClassHeritage -> '(' IdentList ')'
ClassVisibility -> [PUBLIC | PROTECTED | PRIVATE | PUBLISHED]
ClassFieldList -> (ClassVisibility ObjFieldList)/';'...
ClassMethodList -> (ClassVisibility MethodList)/';'...
ClassPropertyList -> (ClassVisibility PropertyList ';')...
PropertyList -> PROPERTY Ident [PropertyInterface] PropertySpecifiers
PropertyInterface -> [PropertyParameterList] ':' Ident
PropertyParameterList -> '[' (IdentList ':' TypeId)/';'... ']'PropertySpecifiers -> [INDEX ConstExpr] [READ Ident]
[WRITE Ident]
[STORED (Ident | Constant)]
[(DEFAULT ConstExpr) | NODEFAULT]
[IMPLEMENTS TypeId]InterfaceType -> INTERFACE [InterfaceHeritage] [ClassMethodList]
[ClassPropertyList]
ENDInterfaceHeritage -> '(' IdentList ')'
RequiresClause -> REQUIRES IdentList... ';'
ContainsClause -> CONTAINS IdentList... ';'
IdentList -> Ident/','...
QualId -> [UnitId '.'] Ident
TypeId -> [UnitId '.'] <type-identifier>
Ident -> <identifier>
ConstExpr -> <constant-expression>
UnitId -> <unit-identifier>
LabelId -> <label-identifier>
Number -> <number>
String -> <string>
解决方案 »
- 获取已经在IE中打开的网页的源代码
- 求助:非常非常急,各位大哥请给个把 DBGRID 里数据导入到 excel 的例子,好吗?
- 求教,怎样能才把DBGRID里显示字段的值,点击后调用IE直接打开。。
- BDE配置问题(出现**)
- 如何自己做一个禁用网卡启用网卡的程序?
- Record泛型会导致下标越界
- 共享软件中常用的生成与本机对应的唯一机器辨识号的作为注册依据的方法是怎样实现的?
- 怎样发布用websnap 制作的的web程序?
- 请问在Delphi中能否像在VB中生成控件数组?请高手们请教,答到的定送上100分
- val函数怎么用啊!!
- 如何改变TlistView中单独一行的颜色?
- 送分给Delphi版的兄弟,VC天堂网开张!www.vcheaven.net
case myVar of
value1:
begin
……
end; //注意我这里有分号,是正确的。
else begin
……
end;
end; //case
case Read_Buffer[datacnt] of
#13: begin
if (lineData[1]='!') and (CurrentID<17)
then begin //AA6命令 的回应值。
GetChStat(CurrentID); //判断通道的状态
ChStatus[CurrentID].WaitCount:=0; //设置此通道通信无错。
dataReceived:=True;
end; if (lineData[1]='>')and ((lineData[2]='+')or(lineData[2]='-') ) and (CurrentID>16)
then begin //温度采样
tempHandle(CurrentID);
end;
LineData:='';
end;
else begin //非chr(13) 字符 要读出来。
if (Read_Buffer[datacnt]='!') or (Read_Buffer[datacnt]='>')
then LineData:=''; //1011 modify
//没读到 #13却有应答的'!' 或'>'开始字符,说明以前字符乱码,故弃掉。
LineData :=LineData+Read_Buffer[datacnt];
if length(lineData)>60 then linedata:='';
end;
end; //case
case Index of
1: State := MS_CTS_ON;
2: State := MS_DSR_ON;
3: State := MS_RING_ON;
4: State := MS_RLSD_ON;
else
State := 0;
end;
绝对正确
if (strmy = 'Wrinkle') then
TempImager := WrinkleImager
else if (strmy = 'Linen') then
TempImager := LinenImager
else if (strmy = 'Parchment') then
TempImager := ParchmentImager
else if (strmy = 'Mosaic') then
TempImager := MosaicImager;用IF语句一切1正常而改为CASE后出现错误: case strmy of
'Wrinkle': TempImager := WrinkleImager;
'Linen':TempImager := LinenImager ;
'Parchment':TempImager := ParchmentImager ;
'Mosaic':TempImager := MosaicImager;
end;说类型不匹配
请大家看一下。