コード例 #1
0
        public FixedType(PredefinedTypeSyntax syntax, Package containingPackage, int bitLength, bool isSigned, int fractionalBits)
            : base(syntax, containingPackage, bitLength, isSigned)
        {
            Requires.That(fractionalBits <= bitLength, nameof(fractionalBits), "Must be less than bit length");

            FractionalBits = fractionalBits;
        }
コード例 #2
0
 public VoidType(PredefinedTypeSyntax syntax, Package containingPackage)
     : base(syntax, containingPackage)
 {
     Requires.That(syntax.Name.Text == "void", nameof(syntax), "Syntax must be for void type");
 }
コード例 #3
0
 public IntType(PredefinedTypeSyntax syntax, Package containingPackage, int bitLength, bool isSigned)
     : base(syntax, containingPackage, bitLength, isSigned)
 {
     var prefix = isSigned ? "int" : "uint";
     Requires.That(syntax.Name.Text.StartsWith(prefix), nameof(syntax), $"Syntax must be for {prefix} type");
 }
コード例 #4
0
 public StringType(PredefinedTypeSyntax syntax, Package containingPackage)
     : base(syntax, containingPackage)
 {
     Requires.That(syntax.Name.Text == "string", nameof(syntax), "Syntax must be for size type");
 }
コード例 #5
0
 protected SignedType(PredefinedTypeSyntax syntax, Package containingPackage, int bitLength, bool isSigned)
     : base(syntax, containingPackage, bitLength)
 {
     IsSigned = isSigned;
 }
コード例 #6
0
 public OffsetType(PredefinedTypeSyntax syntax, Package containingPackage)
     : base(syntax, containingPackage)
 {
     Requires.That(syntax.Name.Text == "offset", nameof(syntax), "Syntax must be for offset type");
 }
コード例 #7
0
 protected PredefinedType(PredefinedTypeSyntax syntax, Package containingPackage)
     : base(syntax, containingPackage)
 {
 }
コード例 #8
0
 protected SizedType(PredefinedTypeSyntax syntax, Package containingPackage, int bitLength)
     : base(syntax, containingPackage)
 {
     BitLength = bitLength;
 }